ds_queue_head

此函数将仅 读取 队列的第一个值 (" 头部 ")。它不会将该值 出列 ,这意味着将来仍可以通过该函数或 ds_queue_dequeue() 读取该值。如果队列为空,则该函数将返回常量 undefined,否则将返回队列中包含的值。

 

语法:

ds_queue_head(id);

参数类型描述
idDS Queue要读取的数据结构的ID。

 

返回:

Any (Data type value stored in the queue)

 

例子:

num = ds_queue_head(control_queue);

上面的代码将从变量 "control_queue" 中索引的队列中读取头值,并将返回值存储在变量 "num" 中。