Quote:
Originally Posted by Samposse
PHP Code:
funcion onCreated() { var.1 = "Hello World"; echo var.1;
|
It's a mix between languages there... this would work better
PHP Code:
function onCreated()
{
this.var1 = "Hello World!";
echo(this.var1);
}
GS2 (the current language) requires the use of ( ) to designate a function. The reason that may work is because gs1 used the 'function var' syntax without the use of parenthesis. Also, while var.1 would technically work, it's a strange way of doing it within gscript
As for the other script, placing a, "return; straight after the function is caused would stop the execution right there as returns stop what the function is doing and returns a result to the original caller (in this case, 0 since no value was supplied. I am not sure what you were trying to achieve with that return