![]() |
GS2: Local variables
I was wondering, Torque Script has them, so why have them be removed from GS2? Having those would really easen things.
I'd guess there were some problems including them, but I'd really appreciate it if we could get something similar. (I am talking about variables that won't exist over the current scope, like explained in http://tork.beffy.de/uploads/liquid.net/tutorial1.htm) |
Quote:
In new Graal script variables are by default global (like in old scripting engine on clientside), and you can limit the scope by putting this., player., server., temp. etc. in front. |
The only way to do local variables right now is define them in the function arguments. I agree with you, the removal of local/global variable scope sucks. :(
Quote:
In TorqueScript you have %local, and $global variables. |
Quote:
Quote:
|
Quote:
function foo() { foovar = "hello"; bar(); } Now function bar shouldn't have access to foovar, yet it does and it is one big source for errors. Like when you use some function someone else made, and it changes a variable you use in your function that calls this 3rd party function. EDIT: A-hah, so temp. vars replace them :) Well, that answers my question, thanks very much. |
Quote:
|
| All times are GMT +2. The time now is 08:30 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.