压栈


描述

With this action you can push a value onto a stack data structure. You supply the variable that holds the stack index (as returned by the action Create Stack) and then give the value to push onto the top. With stack data structures, values are always added onto the "top" of the stack, and never at the end or in the middle (if you require this functionality, then use a list data structure).


动作语法:

Push Onto Stack Syntax


参数:

参数 描述
堆栈 The index (stored in a variable) of the stack to use
The value to push onto the stack


例如:

创建堆栈示例
上面的动作块代码创建了一个实例变量和一个新的堆栈数据结构。堆栈的索引存储在新变量中,然后执行循环,创建10个实例并将其唯一的ID值压入堆栈。