Set final line number

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


Set final line number {line-number (calculation)}


This command explicitly sets the value of LIST.$linecount by specifying a line number or a calculation. Omnis expands or contracts any list as necessary and maintains the value of the LIST.$linecount property as the last line number. If the number of lines in the list is less than the number set for LIST.$linecount, Omnis adds empty lines to the end. If the number of lines is greater than LIST.$linecount, Omnis shortens the list and reduces the memory needed by the list.

You can use Set final line number to speed up list handling by setting the final line number to shorten lists, for example. The list is effectively cleared of data when the line number parameter is left blank (or evaluates to zero).


; Reduce the number of lines in the list
; from 100 to 50
Set current list lMyList
Define list {lCol1}
For lCol1 from 1 to 100 step 1
  Add line to list {lCol1}
End For
OK message {List has [lMyList.$linecount] lines}
Set final line number {50}
OK message {List now has [lMyList.$linecount] lines}