ds_queue_clear

Clears all of the data from a given queue.

Syntax:

ds_queue_clear(id);


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


Returns: N/A


Description

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


Example:

if count = 15 && !ds_queue_empty(command_queue)
   {
   ds_queue_clear(command_queue);
   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_queue indexed in the variable "command_queue", sets an alarm, and resets the variable to 0.


Back: Queues
Next: ds_queue_empty
© Copyright YoYo Games Ltd. 2019 All Rights Reserved