Selection Index

Description

The Set Selection Index block selects a line in the list box after it has been written to. The first line in the list is 1 and the nth line is n. To unselect all lines use the value 0.

When a project is first started the only blocks shown are for the Prompter which is predefined. As Text, Editor, and List objects are added to the project the Read/Write block list grows showing blocks for the added objects

Escapes

If a line number is given that is greater than the total number of lines in the list box then a Parameter Out Of Range Escape Code occurs.

Examples

This block list writes 10 numbers into a list and then sets the selection to the first line.

A button labeled "Next" has this block list.

The selection index is set to one more than the current selection index. On the last selection this procues an exception. This results in program flow going into the recover area where the selection is set back to 1. Clicking the "Next" button sequences through the list and returns to the top to continue cycling.

Related Topics

Get Selection Index