Loading...
 

StepBack

StepBack

StepBack(stmtName)

parameters: Name of an instruction (InstantView macro!)

Stack
Stack Position Description
Stack(In) Top an object box
Stack(Out) Top -

This instruction is essentially the same as Iterate, applied to an object box. The iteration starts with the (last) interactively selected element. Additionally - and in contrast to StepForw - the sequence of listbox entries is run through in the opposite direction (backwards iteration). If no targets are currently selected, StepBack has no effect. For an object box with the flag SELECT_MULTIPLE the last selected object is taken into account. Widget brings an object box onto the stack.

// Define the macro, that must be called as parameter by StepBack
Define(SelectEntryAbove)
  Var(counter)

  // Deselect all entries of the list
 
DeselectAll(, ListBox)
  // Select the actual entry in the list
 
Select(, ListBox)
  // Count the selected entries
 
Incr(counter)

;

// Imagine, there is a ListBox, where an entry at the bottom is selected.
// Set counter to 0

0 -> counter
// Now this command will be executed...
Widget(, ListBox) StepBack(SelectEntryAbove)
// One line after another will be selected and counted, until the first entry in the list is reached!

 

// At the end, show the user, how many lines have been above the selected entry!
T("Zeilen über selektierter Zeile: ", "Lines above selected entry: ") String counter String + Attention(EndTXN)

See also