Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

hi all,

i have a script that, among other things, creates a multiline key to filter a portal by date ranges.

on my layout, i have several buttons that trigger a script using a different set of script parameters. for example, if i click the button labeled '1st quarter', the key field will be populated with something like

1|2011

2|2011

3|2011

and the parameters i pass to the script by clicking the button are

"1¶2¶3" & "1st quarter"

i am using the literal at the end to put on a field of the report so i don't forget it. this all works very nice for all quarters, but i also want button for the first and second half of the year, and also the entire year which will both make the key field longer and requires a longer list of script parameters.

the problem is that the script is evaluating the ¶ characters of the script parameters as delimiters. so if the number of months in my report changes, then some month number gets stuffed into the field of my report that should actually display the report period.

how can i tell filemaker that "1¶2¶3" or any other set of months should be treated as one expression?

thanks,

stefan

Posted

You could use a different delimiter, e.g.:

"1§2§3¶1st quarter"

then do =

Substitute ( GetValue ( Get (ScriptParameter) ; 1 ) ; "§" ; ¶ )

to get the return-separated list of months.

Alternatively, leave the parameter as is, and use =

LeftValues ( Get (ScriptParameter) ; ValueCount ( Get (ScriptParameter) ) - 1 )

to get the list and =

RightValues ( Get (ScriptParameter) ; 1 )

to get the trailing text. This is assuming there always is trailing text.

Posted

hey, not just a solution, but a double-pack of them! thanks much - that wil do the trick!

stefan

This topic is 4695 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.