ds_stack_empty

Returns whether the given stack is empty or not.

Syntax:

ds_stack_empty(id);


Argument Description
id The id of the data structure to check.


Returns: Boolean


Description

With this function you can check the given ds_stack to see if it is empty (returns true) or not (returns false).


Example:

if ai_count == 15 && !ds_stack_empty(AI_stack)
   {
   ds_stack_clear(AI_stack);
   alarm[0] = room_speed;
   ai_count = 0;
   }

The above code checks a variable to see if it has reached a specific value and if it has it clears the ds_stack indexed in the variable "AI_stack", sets an alarm, and resets the variable to 0.


Back: Stacks
Next: ds_stack_size
© Copyright YoYo Games Ltd. 2018 All Rights Reserved