获取所在处的列表项


描述

With this action you can recover the index position of an item within the given list. You supply the variable that stores the list index (as returned by the action Create List) and the index position within the list to get the item value from, as well as a target variable to store the returned item value (which can be flagged as a temporary local variable to be used until the end of the script or event).

注意: If you give a position that is outside of the given list size (ie: position 11 in a 10 value list) then the action will return undefined. You can check for this using the If Undefined action.


动作语法:

获取所在处的列表项


参数:

参数 描述
列表 The index (stored in a variable) of the list to remove from
索引 The index position within the list to get the item from
目标 将要存储返回值的目标变量。


例如:

释放数据结构示例
上面的动作块代码获取全局变量中引用的列表的大小,然后使用重复循环来遍历并销毁存储在列表中ID对应的实例。重复循环完成后,从内存中释放这个列表数据。