Assignments

This section explains the various assignments available.

An assignment simply stores a value in a variable and has the form:

GML Code Example

<variable> = <expression>;


An expression can be a simple value but can also be more complicated, so, rather than assigning a value to a variable, one can also add a value to the current value of the variable using +=, for example:

GML Code Example

a += b;


Similarly, you can subtract it using -=, multiply it using *=, divide it using /=, or use bitwise operators using |=, &=, or ^=. You can also add or subtract one from a value using ++, --.





No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here