you could either use a global:

global gData

gData = 23
window("something").open()
tell window("something")
    foo()
end tell
put gData
-- 46

and in something.dir:

on foo
    global gData
    gData = gData * 2
end

window("miaw").open()
l=[23]
tell window("miaw")
    foo(l)
end tell
put l


OR, use a list as parameter to implement passing by reference:

window("something").open()
data = 23
tmpList = [data]
tell window("something")
    foo(tmpList )
end tell
put tmpList[1]
-- 46

and in something.dir:

on foo (tList)
    tList[1] =  tList[1]*2
end


Valentin


Jon Alongi wrote:
> Hi people/gurus,
> 
> 
> I hope someone can help me.
> 
> 
> I have for hours been trying to work out a solution to no avail.
> 
> Does anyone know if it is possible and how to return a value from a
> MIAW. 
> 
> I am using an object to open up a MIAW, perform a calculation, and
> would 
> then like the result returned to my variable.
> 
> For example:
> 
> MyVariable = fileIO.dosomething("parameter")
> 
> 
> Parent script
> 
> On doSomething me, paremter
> 
> Window("something").open() --perform calculation in the MIAW
> 
> RETURN data
> End
> 
> 
> 
> 
> Is this even possible.
> 
> Id really welcome the advise, no matter how unorthodox.
> 
> 
> 
> Best Regards
> 
> 
> Jon
> 
> 
> 
> 
> [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