Page 1 of 1

What is the syntax for creating a method?

Posted: August 3rd, 2010, 10:48 am
by Venima
What is the syntax for creating a method?

To show you roughly what I mean, newgui <name> [] creates a gui. But I want to run a block of code that doesn't have a gui, but does have a name.

What is the syntax for:

1. Creating the method (e.g. in C++ it would be something like void <name> {etc.})

2. Calling the method (e.g. in C++ it would be <name>();)

Re: What is the syntax for creating a method?

Posted: August 3rd, 2010, 8:17 pm
by Hirato
in cubescript these are called aliases. the proper term for those things in other programming languages, is function.
there are plenty of examples here http://sandboxgamemaker.com/wiki/index. ... Cubescript

Code: Select all

  myalias = [echo hi!]
  myalias
I'll write something a bit later regarding arguments

Re: What is the syntax for creating a method?

Posted: August 4th, 2010, 4:27 pm
by Venima
ahhh right...that makes sense now thanks.