Stack/Queue Insert Item

   

[FinalBuilder Professional Edition]

 

The Stack/Queue Insert Item action is used to push an item at a particular location in the list.

 

StackQueueInsert

 

Stack/Queue name - select the name of the list which you want to add new items to.  If there aren't any items in this list, you need to use the Stack/Queue Define action to create a new list.

 

Item to Insert - the text of the item to insert into the list

 

At Index - the index to insert the item.  Specifying an invalid index will cause the action to fail.  The index is zero based, see NOTE below.

 

Expand variables before insert - if you specify variables as part of the text to push, eg. %MyVariable% then selecting this option will expand the variables before the item is pushed onto the list.

 

NOTE: Using this action requires you to understand the underlying implementation.  Internally both queues and stacks are represented by a zero based array.  Items are always popped from element 0.  A stack pushes new items at element 0, whereas a queue adds new elements to the end of the array.