January 15, 201213 yr 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
January 15, 201213 yr 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.
January 16, 201213 yr Author hey, not just a solution, but a double-pack of them! thanks much - that wil do the trick! stefan
Create an account or sign in to comment