Grouping with lists in a script
Wilhelm Sanke
sanke at hrz.uni-kassel.de
Sun Mar 9 17:48:01 EST 2003
On Sun, 09 Mar 2003, miscdas at boxfrog.com wrote:
> I think the entry for this in the MetaTalk Reference needs to be updated to
> clarify the very issue you raised. Intuitvely, when I encounter the term
> "list", I think of a group of "items" that have a common delimiter, enabling
> me to "buld" a list in a rather simple manner. My first go-'round with this
> was to try to prepare a string comprising the list of controls, trying
> different delimiters. Of course, that totally didn't work. I finally settled
> on the concatenation method demonstrated in the docs. (But I still don't
> like it.)
> miscdas
>
The whole thing boils down to the problem, that even a list -
concatenated with "and" - does not work, if you generate it in a
repeat-loop and put it in into a variable.
In my case the script line"group Fieldlist" (Fieldlist containing "field
ID 1004 amd field ID 1005 and field ID 1006..." etc) apparently does not
work, because "group" as a command cannot access the literal value of
the variable "Fieldlist" - as it is on a different level of internal
coding (This may not be programmers' terminology, but you probably know
what I want to say).
However, once you add "group" as the first word of the variable
Fieldlist and then put "do" before Fieldlist as in
"do Fieldlist"
everything eventually works fine, because "group" is now on the same
level as a part of "Fieldlist".
I dimly remember a discussion on this Metacard-list of how to get at
the literal value of a variable (Richard Gaskin? comes to my mind), but
I am unsure if the recommended solutions apply to our problem in "group
Fieldlist".
So, using the "do"-command as a solution - if there isn't another -
should be added to the Metacard documentation.-
Regards,
Wilhelm Sanke
More information about the metacard
mailing list