ds_stack_size

Returns the number of values stored in the given stack.

语法:

ds_stack_size(id);


参数 描述
id The id of the data structure to check.


返回: Real(实数)


描述

This function will return the "size" of the stack, ie: the number of items that have been pushed onto it.


例如:

if !ds_stack_empty(control_stack)
   {
   num = ds_stack_size(control_stack);
   }

The above code checks a ds_stack to see if it is empty or not, and if it is not, it gets the number of items that it contains and stores the value in a variable.


上一页: Stacks
下一页: ds_stack_copy
© Copyright YoYo Games Ltd. 2018 All Rights Reserved