Empty a lot of fields at once
Posted: Wed May 07, 2014 7:03 pm
Right now, I have 20 fields that I put empty into; and also I put 0 into 35 fields on a mouseUp... is there a faster way of clearing a lot of fields at once?
Questions and answers about the LiveCode platform.
https://www.forums.livecode.com/
Code: Select all
...
## Always lock the screen when updating lot of controls!
lock screen
repeat with i = 1 to 20
put EMPTY into fld i
end repeat
unlock screen
...
Code: Select all
...
## Always lock the screen when updating lot of controls!
lock screen
repeat with i = 1 to 35
put "0" into fld i
end repeat
unlock screen
...
dunbarx wrote:Pay no attention to what Klaus wrote. Do it my way.
Craig
Code: Select all
repeat for each line fieldToEmpty in field "fieldlist" on card "data"
do "put empty into field""e&fieldToEmpty"e
end repeat
repeat for each line fieldToZero in field "fieldlistcounters" on card "data"
do "put 0 into field""e&fieldToZero"e
end repeat
Code: Select all
...
repeat for each line fieldToEmpty in field "fieldlist" of card "data"
put empty into field fieldToEmpty
end repeat
repeat for each line fieldToZero in field "fieldlistcounters" of card "data"
put 0 into field fieldToZero
end repeat
...