Posted: Thu Nov 22, 2007 3:02 am |
|
Quote: |
What is the scope of variables inside Awakening ? If i define variable in one script, can other scrip access its value?
|
You can access other Script's variable, but it's exection order dependent.
For example:
Script1 with codes:
testNum=8
local testLocal=9
|
Script2 with codes:
do Script1, do Script2, output result:
8 nil
do Script2, do Script1, output result:
nil nil
Quote: |
Is every defined variable Global exept those marked Local? |
Yes, in LUA, whether define variable in a function, or in global scope, you need marked 'local' for Local Variable; variables without 'local' marked are all Global.