array_push

With this function you can push a value (or values) onto the end of an array without having to know the length of the array. The function requires you to provide a variable that holds the array as well as at least one value to push, although you can optionally provide further arguments and they will all be pushed onto the array in consecutive order.

 

Syntax:

array_push(variable, value, [value], [value], [etc...]);

ArgumentTypeDescription
variableArrayThe variable that holds the array.
valueAnyThe value to push onto the end of the array
[value], [value], [etc...]AnyOPTIONAL Further values to be pushed onto the array

 

Returns:

N/A

 

Example:

array_push(score_array, obj_Player1.scr, obj_Player2.scr, obj_Player3.scr, obj_Player4.scr);

The above code will push four values onto the end of the given array.