A script question

Mark Smith mark at maseurope.net
Fri Jul 13 07:13:32 CDT 2007


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.

Best,

Mark

ps. in cases like these I generally don't bother putting the list of  
names in a variable, I do this:

repeat for each item i in   
"name2,examier2,vsmiFld,vsmiFld2,ci1,vsmiFld3,vsmiFld5,vsmiFld4"
   put empty into fld i
end repeat

So there's yet another variation...

On 13 Jul 2007, at 13:05, LunchnMeets at aol.com wrote:

>
> In a message dated 7/12/07 7:58:18 PM, cszasz at mac.com writes:
>
>
>> I have tried to use the following script to clear fields but I am  
>> getting a
>> weird error message in the script editor:
>> chunk: no such object
>> file
>> put empty into field tName
>>
>> This is weird because field tName is a variable.
>>
>> Here is the script:
>>
>> put  
>> "name2,examier2,vsmiFld,vsmiFld2,ci1,vsmiFld3,vsmiFld5,vsmiFld4" into
>> tNames
>> REPEAT for each item tName in tNames -- Clears all fields
>> put empty into field tName
>> END REPEAT
>>
>> I don't have to use this script but I hate to empty the fields the  
>> long way:
>>
>> put empty into field "name2" of card "index"
>> put empty into field "examiner2" of card "index"
>> put empty into field "vmiFld" of card "Index"
>>
>> etc.
>>
>> Can anyone tell me why repeat script does not work?
>>
>
> I still consider myself a newbie. Up until now I have used this  
> list to ask
> questions when I get stumped. This question was educational for me  
> too. Up
> until now I would have scripted the above like this
>
> put "name2,examiner2,vsmiFld2,ci1,vsmiFld3,vsmiFld5,vsmiFld4" into  
> tNames
>
>   repeat with R1 = 1 to num(items) of tNames
>     put "" into fld item R1 of tNames
>    end repeat
>
> Is there any advantage in the other method or is it just another  
> way of doing
> the same thing? Revolution is great in that there’s usually several  
> ways of
> doing something and most of the time that’s the point, Still I’d  
> like to be
> the most efficient.
>
> Thanks again to all the people that contribute so much time to make  
> this so
> very helpful. I’d be lost without all of you.
>
> Joe in Orlando
>
>
> **************************************
>  Get a sneak peak of the
> all-new AOL at http://discover.aol.com/memed/aolcom30tour
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list