Repeat with a list
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Repeat with a list
My attempts to spit the list into a few lines have all failed.
I see that the symbol to use is "\".
How can I do this?
repeat for each item tItem in "Black10Record,High10Record,Low10Record,Odd10Record,Even10Record,Red10Record,Black20Record,High20Record,Low20Record,Odd20Record,Even20Record"
set the visible of field tItem to "false"
end repeat
Can't get the code to insert correctly.....the list should be on the "repeat" line and the " at the end of the list
has disappeared....
I see that the symbol to use is "\".
How can I do this?
repeat for each item tItem in "Black10Record,High10Record,Low10Record,Odd10Record,Even10Record,Red10Record,Black20Record,High20Record,Low20Record,Odd20Record,Even20Record"
set the visible of field tItem to "false"
end repeat
Can't get the code to insert correctly.....the list should be on the "repeat" line and the " at the end of the list
has disappeared....
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
Re: Repeat with a list
Hi,
try false instead of "false", it's a constant and not a string!
And to have it better readable, try:
Have fun!
try false instead of "false", it's a constant and not a string!
And to have it better readable, try:
Code: Select all
put "Black10Record,High10Record,Low10Record," & \
"Odd10Record,Even10Record,Red10Record,Black20Record," & \
"High20Record,Low20Record,Odd20Record,Even20Record" into MyVar
repeat for each item tItem in MyVar
set the visible of field tItem to false
end repeat
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
Re: Repeat with a list
Hi.
"false" does not fool the LC parser. It will work fine either way. I always place such constants in quotes.
That said, please post verbatim the lines that are throwing the error. It is likely just a small typo or syntactical error.
Craig Newman
"false" does not fool the LC parser. It will work fine either way. I always place such constants in quotes.
That said, please post verbatim the lines that are throwing the error. It is likely just a small typo or syntactical error.
Craig Newman
Re: Repeat with a list
Perhaps try this instead:RossG wrote:My attempts to spit the list into a few lines have all failed.
I see that the symbol to use is "\".
How can I do this?
repeat for each item tItem in "Black10Record,High10Record,Low10Record,Odd10Record,Even10Record,Red10Record,Black20Record,High20Record,Low20Record,Odd20Record,Even20Record"
set the visible of field tItem to "false"
end repeat
Can't get the code to insert correctly.....the list should be on the "repeat" line and the " at the end of the list
has disappeared....
Code: Select all
repeat for each item tItem in "Black10Record","High10Record,"Low10Record,"Odd10Record","Even10Record","Red10Record","Black20Record","High20Record","Low20Record","Odd20Record","Even20Record"
set the visible of field tItem to "false"
end repeat

Re: Repeat with a list
dont forget to set the item delimiter
Code: Select all
set itemDelimiter to comma
put "Black10Record,High10Record,Low10Record,Odd10Record,Even10Record,Red10Record,Black20Record,High20Record,Low20Record,Odd20Record,Even20Record" into myList
repeat for each item titem in myList
set visible of fld titem to false
end repeat
Re: Repeat with a list
locking the screen before the repeat loop and unlocking it after speeds this up tremendously.
Kind regards
Bernd
Kind regards
Bernd
Re: Repeat with a list
The problem was lack of the "&".
I thought that the "\" would assume the following
line was to be concatenated, but it's not so.
BTW Am I the only one who always gets it wrong
between
repeat with
and
repeat for.
Seems that one or the other should be sufficient.
"repeat for" is, as far as I can remember, the usual
in other languages.
I thought that the "\" would assume the following
line was to be concatenated, but it's not so.
BTW Am I the only one who always gets it wrong
between
repeat with
and
repeat for.
Seems that one or the other should be sufficient.
"repeat for" is, as far as I can remember, the usual
in other languages.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.