| All times are GMT - 8 Hours |
| #1: |
| #2: |
| Code: |
|
global var1, var2 -- declare 2 global variables put "hello" into var1 put 1 into var2 put "initial handler" into handlerName -- a local variable put "START: " & handlerName && var1 && var2 -- display our variables put function1() -- call function1 and display its return value command1 -- call command1 put "END: " & handlerName && var1 && var2 -- display our variables function function1 global var1 -- declare only var1 as a global here put "function1" into handlerName -- a local variable put 1000 into var2 -- this var2 is local to function1 return "Returned From: " & handlerName && var1 && var2 end function1 on command1 -- Note: don't declare any globals up front in this handler put "command1" into handlerName -- a local variable add 6 to global var2 -- add to the var2 global variable put "I'm local" into var1 -- this is the var1 variable local to command1 put "Greetings!" into global var1 -- now change the global var1 put handlerName && global var1 && var1 && global var2 end command1 |
| #3: |
| Quote: |
|
global defaultList, secondList put (("Print","1"),("Print","2")) into defaultList put (("Cancel","1"),("Cancel","2")) into secondList |
| Quote: |
|
start using "File_1.script" put defaultList &&& secondList into list put item 1 of list put item 3 of list |
| #4: |
| Code: |
| global defaultList, secondList |
| #5: |
Output generated using Printer-Friendly Topic Mod.