Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 5591 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

I am trying to gather the layout names in an IF statement. Below is what I am trying to do with multiple options, but can't get it right. Any help is appreciated. thanks!

If [RightWords ( Get ( LayoutName ) ; 1 ) = "menu" or "detail" or "details" or "issues" or "edit" or "adminEdit" or "check" or "admin" or "list" or "MSLlist" or "status" ]

*******************************

OK,

I was able to make the following work. But is there a cleaner way to do this?

If [ RightWords ( Get ( LayoutName ) ; 1 ) = "menu" or RightWords ( Get ( LayoutName ) ; 1 ) = "detail" or RightWords ( Get ( LayoutName ) ; 1 ) = "details" or RightWords ( Get ( LayoutName ) ; 1 ) = "issues" or RightWords ( Get ( LayoutName ) ; 1 ) = "edit" or RightWords ( Get ( LayoutName ) ; 1 ) = "adminEdit" or RightWords ( Get ( LayoutName ) ; 1 ) = "check" or RightWords ( Get ( LayoutName ) ; 1 ) = "admin" or RightWords ( Get ( LayoutName ) ; 1 ) = "list" or RightWords ( Get ( LayoutName ) ; 1 ) = "MSLlist" or "status" ]

Edited by Guest
new information
Posted (edited)

Try this

If [

RightWords ( Get ( LayoutName ) ; 1 ) = "menu" or

RightWords ( Get ( LayoutName ) ; 1 ) = "detail" or

RightWords ( Get ( LayoutName ) ; 1 ) = "details"

]

The above is a much shortened version of your requirement. Notice that each "quoted" item is compared individually. For ease of reading the individual tests are separated to different lines, which FM will permit you to do.

Edited by Guest
Posted (edited)

How about using something like this?

If [

not IsEmpty(

FilterValues(

"menu¶detail¶details¶issues¶edit¶adminEdit¶check¶admin¶list¶MSLlist¶status";

RightWords ( Get ( LayoutName ) ; 1 ) )

)

]

Edited by Guest
Posted

Even less is needed:

If[

PatternCount(

"¶menu¶detail¶details¶issues¶edit¶adminEdit¶check¶admin¶list¶MSLlist¶status¶";

"¶" & RightWords( Get( LayoutName ); 1 ) & "¶"

)]

Posted

Thanks both. I understand the FilterValue version. I am confused on the PatternCount.

Your returns "¶" are separating the words, and also is the pattern being looked for. The combination of the word & "¶", correct? Could this character be anything? Say the underscore "_" ? That is already in the layout names, ie, _form, _guest, etc.

Then you are making that combination with the Get & "¶".

What is the & "¶" at the end of the calc for ?

Posted

Thanks, I did get it to work as follows. I didn't understand the extra "¶" at the end and didn't use it. I also changed to the underscore "_". It all seems to be working. Thank you so much!

PatternCount ( "_menu_detail_details_issues_edit_adminEdit_check_admin_list_MSLlist_status" ; "_" & RightWords ( Get ( LayoutName ) ; 1 ) ) or PatternCount ( "_form_guest_detail_guest" ; "_" & RightWords ( Get ( LayoutName ) ; 2 ) )

Posted

...since you had "detail" both in singular and plural, would the patterncount arrive to two - my calc searches for the entire string including the pilcrow delimiter in both ends of each category, not that it matters in a if statement but more not to clutter the logic behind.

--sd

This topic is 5591 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.