Scripting what should be a simple loop...

Bob Sneidar bobs at twft.com
Fri Jul 9 19:45:20 EDT 2010


Hi Mark. 

That won't work because the fields themselves are named "Field1 Field2". He is not referencing the fields by their numbers but rather by their names. A bit confusing but I got it.

Bob


On Jul 9, 2010, at 4:37 PM, Mark Schonewille wrote:

> Hi David,
> 
> Whenever you discuss something that involved an error, you really should post the error message together with your question. It helps. Really, it does.
> 
> Now to your answer. I am not exactly sure what to answer, because I don't know the error message, but I can make a guess.
> 
> It is recommendable to use arrays in this case:
> 
> repeat for i = 1 to 10
>  put fld i of grp "AllFields" into tVar[i]
> end repeat
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
> 
> Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce
> 
> On 10 jul 2010, at 01:23, David C. wrote:
> 
>> Good grief! Will someone be so kind as to show me the proper way to
>> format my script...
>> 
>> Let's say I have the following
>> 
>> 1 group named "AllFields" containing:
>> 10 text fields, named Field1...Field10
>> 10 temporary variables named tVar1...tVar10
>> 
>> All I want to do, using a loop, is to put the user supplied data
>> contained in each field into the corresponding, like-named variable. I
>> thought I could do something easy like this
>> 
>> repeat for i = 1 to 10
>> put fld "Field" & i of grp "AllFields" into tVar & i
>> end repeat
>> 
>> I know that I've done this before, but so far I've yet to find the
>> right format that will not cause an error when compiling the script
>> -and- would greatly appreciate it if some kind soul would rescue me
>> from this madness.
>> 
>> FWIW, I recently had another fifty-something birthday, so I'm blaming it
>> all on an increasing case of dementia. As in:
>> 
>> "Dementia (meaning "deprived of mind") is a serious loss of cognitive
>> ability in a previously unimpaired person, beyond what might be
>> expected from normal ..."
>> 
>> 
>> Best regards,
>> David C.
> 
> 
> _______________________________________________
> 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