ds_queue_enqueue

Adds the given value (or values) into the given queue.

Syntax:

GML Code Example

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


Argument Description
id The id of the queue to add to.
val The value to add to the queue.
[val2, ... val15] Optional values to be added to the queue.


Returns: N/A


Description

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.


Example:

GML Code 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.


Back: Queues



No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here