As there is only a single pseudo variable selected line, you cannot nest for each selected line loops, either directly, or via calls to routines, which also contain a for each selected line loop. Use the selected line built-in function to access the currently selected line in a for each selected line loop statement. ESL returns an integer value representing the line number.
For example:
for each selected line of ListBox loop
copy (textual line (selected line) from ListBox) to Text
call ProcessLine(Text)
end loop
During a for each selected line loop, you must not insert or change any lines within the list box, although you may use the remove action statement to delete the selected line.
For example:
for each selected line of ListBox loop
remove (selected line) from ListBox
end loop
As there is only a single pseudo variable selected line, you cannot nest for each selected line loops, either directly, or via calls to routines, which also contain a for each selected line loop.