Not Logged In

Click To Login

passvars

— Guide home

Passing/Returning Variables

When creating a new sub you may choose to specify parameters. These parameters may either be by value or by reference

When you pass a variable by value the variable will revert back to its original value after the called sub has exited.

When passing a variable by reference any changes made to that variable by the called sub will persist after the sub has exited. This is how you return values within Pyxis.

To pass a variable by reference you need only put a * after the variable type.

Example:
sub xLine(int x, int* y)
x is being passed by value
y is being passed by refrence