Thread: MASM/Vb6 to GS2
View Single Post
  #8  
Old 12-08-2009, 12:10 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Samposse View Post

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
Reply With Quote