ds_queue_enqueue

This function will add a value (real or string) onto the tail of the DS queue. The function can take a further 14 optional arguments (making a total of 15 possible additions), permitting you to add multiple values consecutively to the tail of the queue in a single call.

 

Syntax:

ds_queue_enqueue(id, val [, val2, ... val15]);

ArgumentTypeDescription
idDS QueueThe id of the queue to add to.
valAnyThe value to add to the queue.
[val2, ... val15]AnyOptional values to be added to the queue.

 

Returns:

N/A

 

Example:

move_queue = ds_queue_create();
ds_queue_enqueue(move_queue, x + 200);
ds_queue_enqueue(move_queue, y);
ds_queue_enqueue(move_queue, x + 200);
ds_queue_enqueue(move_queue, y + 200);
ds_queue_enqueue(move_queue, x);
ds_queue_enqueue(move_queue, y + 200);
ds_queue_enqueue(move_queue, x);
ds_queue_enqueue(move_queue, y);

The above code creates a new DS queue and stores its index in the variable "move_queue". It then pushes a number of values onto the queue for future use.