A script question

Eric Chatonet eric.chatonet at sosmartsoftware.com
Fri Jul 13 09:37:44 EDT 2007


And this is the reason why locking screen every time you can is  
important:

put <fields list> into tNames
lock screen
   REPEAT for each item tName in tNames
     put empty into field tName
   END REPEAT
unlock screen

Only one screen refresh :-)

Le 13 juil. 07 à 15:18, Ken Ray a écrit :

> On Fri, 13 Jul 2007 13:13:32 +0100, Mark Smith wrote:
>
>> The 'repeat for' is generally a lot faster then the 'repeat with',
>> but in a case like this with only a few iterations, it wouldn't make
>> a noticable difference. But with long lists, it can really make a
>> huge difference.
>
> Also keep in mind that in a script like this, you're "touching" a  
> field
> (manipulating its contents) every iteration through the loop, which
> will slow it down anyway. So even if you had 1000 fields on a card I
> doubt you'd gain much with "repeat for each" vs. "repeat with".
>
>
> Ken Ray

Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list