Sure, you can do recursion.

However, if you want to pick up the result, you'll have to do it when you call, as in:
myResult =createList(oldList, newList)

Then do whatever (add it to the other list, pass it back, etc.)

At 07:09 AM 11/27/02, Erik Phalet wrote:
Hello,
Is it possible to return the result of a recursive loop to the handler that
called the loop, instead of to the previous instance of the handler itself ?
I am not sure the question is accurate, but you can check out what I mean
with this example-moviescript.

on startMovie
myList = [5,6,7]
myPropList = createList(myList)
put myPropList
end

on createList oldList, newList
if not ilk(newList,#list) then
newList = []
end if
if oldList.count > 0 then
newList.add(oldList[1])
oldList.deleteAt(1)
createList(oldList, newList)
else
propertyList = [#propName:newlist]
end if
return propertyList
end

The value that is returned to startMovie is VOID, while I need it to be the
constructed propList.
If I put a breakpoint on the line "return propertyList", I see what is
happening, but how can I pass my return value through this stack ?

sincerely,

Erik Phalet
> Tel * +32-(0)2-751 45 29
> GSM * 0473 86 41 36
> Mail * mailto:[EMAIL PROTECTED]
>
> www.theWizard.be
> Interactive Communication
> Registered Office * Machelsesteenweg 67,1820 Melsbroek, Belgium
> Production * Zandvoortstraat 8, 2800 Mechelen, Belgium
>
>
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/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 Lingo. Thanks!]
[To remove yourself from this list, or to change to digest mode, go to http://www.penworks.com/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 Lingo.  Thanks!]


Reply via email to