Quote:
Originally Posted by ApothiX
Not everything will work in the editor.
Variables without prefixes are Global. It doesn't work like that in the editor though, because variables without prefixes prior to the new engine functioned the same way was temp. variables do now.
|
Compare:
Old GraalScript
PHP Code:
if (created) {
i=50;
test();
message #v(i);
}
function test() {
i=30;
return;
}
The above code displays "30"
New GraalScript
PHP Code:
function onCreated() {
temp.i=50;
test();
message(temp.i);
}
function test() {
temp.i=30;
return;
}
The above code displays "50"
And another thing, in the editor, I placed two scripts:
PHP Code:
if (created) i=234;
PHP Code:
if (created) message #v(i);
And the second displayed "234"
Let's not confuse people with false information now. Variables without prefixes are global, and have been global (with some exceptions).