Technically it's the same call, just different syntax.
As opposed to using the loop, which is actually a different technique.
At 07:26 AM 11/16/00 -0800, Neil Madsen wrote:
>>There's also a shortcut, if you know your way around, which is:
>>
>>on doit
>> myList =[]
>> setAt(myList, 100, 0
>There's also a shortcut, if you know your way around, which is:
>
>on doit
> myList =[]
> setAt(myList, 100, 0)
>end
Don't forget this shortcut
on doit
myList = []
myList[100] = 0
end
>But either way, you now have a list with 100 slots initialized to 0.
Later.
...Neil
[To remove
Goodness, how about using a list instead? It'll give you 100 (or 1000's)
of variable "slots".
To take your example directly, it'd be:
on doit
myList =[]
repeat with i=1 to 100
myList[i] =0
end repeat
end
There's also a shortcut, if you know your way around, which is:
on doit
Fumio Nonaka wrote
> You do not need 'repeat' loop. ;-)
Hi Fumio,
true -- but I reckons its a little less intuitive than explicitly setting
each list entry.
PS -- I was loitering around updateStage's quirk list and clicked a link to
Attain's website - and noticed you guys did a port of Maratho
Hi,
You do not need 'repeat' loop. ;-)
_
Luke Wigley wrote:
> global gList
>
> on doIt
> gList = []
-- repeat with j = 1 to 100
-- gList[j] = 0
-- end repeat
gList.setAt(100, 0)
> end
Good luck,
Fumio Nonaka
Attain Corporation
[EMAIL PROTECTED]
[To remove yourself from this
'do' eh!
Thank you for that!
Jason.
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Ling
Jason & Merav wrote
> Hi,
>
> I want create 100 variables called 'var1', 'var2' 'var100'.
>
> my handler currently reads :
>
> on doit
> repeat with i = 1 to 100
> "var"&i = 0
> end repeat
> end
>
> but Lingo doesn't like the fact that my code is trying to set a string ...
> not a variab
Hi Jason,
Try to modify one statement like the below.
_
Jason & Merav wrote:
> I want create 100 variables called 'var1', 'var2' 'var100'.
>
> my handler currently reads :
>
> on doit
> repeat with i = 1 to 100
do "var"&i & "= 0"
> end repeat
> end
>
> but Lingo doesn't like
Hi,
I want create 100 variables called 'var1', 'var2' 'var100'.
my handler currently reads :
on doit
repeat with i = 1 to 100
"var"&i = 0
end repeat
end
but Lingo doesn't like the fact that my code is trying to set a string ...
not a variable. Is there a way to do this
Thanks