ds_stack_clear

With this function you can clear all data from the given stack data-structure. This does NOT destroy the data-structure (for that you should use ds_stack_destroy()) it only wipes all data from it and returns an empty stack.

 

Syntax:

ds_stack_clear(id);

ArgumentTypeDescription
idDS StackThe id of the data structure to clear.

 

Returns:

N/A

 

Example:

if (ai_count = 15 && !ds_stack_empty(AI_stack))
{
    ds_stack_clear(AI_stack);
    alarm[0] = game_get_speed(gamespeed_fps);
    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.