Go to next selected line

Command group Flag affected Reversible Execute on client Platform(s)
List lines YES NO NO All

Syntax

Go to next selected line ([From start][,Backwards])

Options

From start If specified, the command starts with the first line of the list rather than the line immediately after the current line
Backwards If specified, the command steps through the list in reverse order; when used with 'From start' the command starts at the end of the list, otherwise if 'From start' is not specified, it starts with the line before the current line

Deprecated Command

This command has been deprecated and is no longer visible in the Code Assistant in the Code Editor (it will not appear when you type the first few characters), although it is still present in Omnis Studio and will continue to function if used in legacy code. You can show this command by disabling the appropriate Command Filter in the Modify menu in the Code Editor.

Description

This command scans a list for selected lines and goes to the first one it finds. It sets the current line (LIST.$line) for the current list (#CLIST) equal to the next selected line in that list.

The Go to next selected line command steps through the list starting at the current line (if no options are selected) until a selected line is found. When a selected line is located, LIST.$line is set equal to that line number. If a selected line is not found, the flag is cleared and LIST.$line is unchanged.

The Backwards option causes the list to be searched in descending order; the From start option causes the list to be searched from the start. If both options Backwards and From start are selected, the list is searched from the end.

Example

# Transfer the value from line 3 to the 2 selected lines
Set current list lMyList
Define list {lCol1}
For lCount from 1 to 10 step 1
  Add line to list {(lCount)}
End For
Calculate lMyList.$line as 3
Load from list
Select list line(s) {1}
Select list line(s) {5}
Go to next selected line (From start)
Replace line in list
Go to next selected line
Replace line in list