I've got a script that normally has script parameters passed via the "parameter" input field. The script expects one or two positional parameters. At present that is handled like this:
List ( "color"; "weight" )
I am making testing changes and I am passing in the values from a field. The field is like this:
color
weight
The script parameter looks like this "color¶weight", and to the trained FMP dev that is going to be a list of two values. But in this case GetValue( Get( ScriptParameter) ; 1 ) returns "color¶weight" and GetValue( Get( ScriptParameter) ; 2 ) returns empty.
After inspecting the value it turns out that the pilcrow is not representing a line feed. It is Char(182).
I can convert the string to a list using Substitute ( Get ( ScriptParameter ) ; Char(182) ; ¶ ).
Is there anything I can do to make the script see a list instead of a string that contains a plicrow?
I can get that "¶" is not the same as ¶ - my guess is that FileMaker replaces ¶ by linefeed - what I don't get is that List ( "color"; "weight" ) would insert the pilcrow as a character instead of linefeed .
Do you get this with only a specific version of FMP/FMPA or with many versions ? Passing a list as a parameter is something done so frequently.
@Malcolm this sounds very strange. It should not be behaving like that. Is it possible you are passing your parameter like this by accident?: Quote ( List ( MyTable::color ; MyTable::weight ) )
That would result in the "stringified" list you describe.
meaning the contents of the field are color¶weight (I assume). My bad.
Are you quoting the field value before passing it in? like: Quote ( Table::fieldThatContainsTheList ) . If so, try passing it in without quoting and each value should be accessible with GetValue()
Please also note: with the release of FileMaker 17, Claris updated the documentation of the ValueCount() function. The updated doc mentions there are actually 4 different characters that will behave as separating values (the carriage return being one of those and the only one the quote function escapes).
This, in my opinion, makes the Quote function unreliable to use to move text around with the intent of isolating values from one another, and can be very dangerous if the input relies on anything the user has access to.