Repeat variable name changing

-= JB =- sundown at pacifier.com
Sat Mar 8 10:01:30 EST 2008


It sounds like you will want to use a repeat structure
like Eric or I mentioned and then create new variables
using the name of the variable and using the & statement
with the name to create the variable.

put "Hello" & 2 into the new name.  But I am not really
sure the proper way to write it so it becomes the name
of a variable.

Someone on the list might have a way to accomplish what
you want that uses an array or something else you haven't
tried.

-=>JB<=-


On Mar 8, 2008, at 6:50 AM, Jim Hamlyn wrote:

> Hi again,
>
> I need the repeat loop to effectively instantiate a new variable  
> each time
> it loops with a name I can reference through the same script.
>
> Or
>
> I need the script to create a variable for each line in the field  
> which I
> can reference from the same script.
>
> Does this make any sense?
>
> Jim H
>
>
>
> From: -= JB =- <sundown at pacifier.com>
> Reply-To: How to use Revolution <use-revolution at lists.runrev.com>
> Date: Sat, 8 Mar 2008 06:22:47 -0800
> To: How to use Revolution <use-revolution at lists.runrev.com>
> Subject: Re: Repeat variable name changing
>
> I may not totally understand what you are trying to
> do but it sounds like you are looking for a repeat
> structure that will change fTime to 1,2,3 etc.
>
> repeat with fTime = 1 to number of lines in fld whatever
> put item 5 of line fTime into whereyouwant
> end repeat
>
> A repeat structure similar to the above would repeat
> for 10 time if the field had 10 lines and then it would
> automatically add 1 to fTime on each repeat & quit
> after it executed the 10th time.
>
> If it does not work properly I may have written it a
> little wrong because I am use to hypercard but just
> ask if it doesn't.
>
> -=>JB<=-
>
>
>
> On Mar 8, 2008, at 5:52 AM, Jim Hamlyn wrote:
>
>> Thanks for the replies so far – wow!
>>
>> Ok it looks like I need to be a little more specific.
>>
>> I’m making a meeting scheduler. The idea is to have a field into
>> which I can
>> paste return separated list of names. I have a field with a start
>> time and a
>> field with a meeting length “Add”. At the moment I’m doing it the
>> long way
>> round:
>>
>> on mouseUp
>>   put fld "StartTime" into tTime1
>>   convert tTime1 to dateItems
>>   add fld "Add" to item 5 of tTime1
>>   put tTime1 into tTime2
>>   add fld "Add" to item 5 of tTime2
>>   put tTime2 into tTime3
>>   add fld "Add" to item 5 of tTime3
>>   convert tTime1 to time
>>   put tTime & ":" & Tab before line 1 of fld "myField"
>> etc
>>
>> Jim H
>>
>
>>
>>
> _______________________________________________
> 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