View Single Post
  #9  
Old 09-26-2006, 06:40 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by ApothiX View Post
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 (createdi=234
PHP Code:
if (createdmessage #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).
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote