-
Notifications
You must be signed in to change notification settings - Fork 1
Foreach
Sancky edited this page Sep 26, 2022
·
1 revision
Loop through a queue.
new Queue:queue<10>;
Queue_InsertValue(queue, 2);
Queue_InsertValue(queue, 5);
Queue_InsertValue(queue, 10);
Queue_InsertValue(queue, 15);
Queue_InsertValue(queue, 20);
Queue_InsertValue(queue, 25);
Queue_Foreach(new i : queue)
{
printf("Element %d", i);
}
// using extended version
Queue_ForeachEx(new i, idx : queue)
{
printf("Element %d - index %d", i, idx);
}-
iis the variable in which is assigned the element. -
idxfor the extended version is the variable in which is assigned the element index.