proceduresetselection
START
,
END

The proceduresetselection statement changes the text selection in the current procedure editor window.


Parameters

This statement has two parameters:

start – starting position for the new selection, starting with 1 to the left of the first character. You can also use negative values, which are measured from the end of the text.

end – ending position for the new selection. If this is less than or equal to the starting position, the selection will be set to an insertion point at the start position.


Description

This statement changes the text selection in the current procedure editor window. It allows a program to change the selection, which otherwise can only be done by clicking on the text. If necessary, Panorama will scroll the text to make sure that the new selection is visible.

This example moves the insertion point to in front of the first character of text.

proceduresetselection 1,1

This example moves the insertion point to after the last character of text.

proceduresetselection -1,-1

You could also use a very large value to move to the end, for example:

proceduresetselection 999999,999999

This example searches for the text zorg and selects it (if it exists):

 local searchFor,spot
 searchFor = "zorg"
 spot = searchanycase(info("proceduretext"),searchFor)
 if spot=0 beep rtn endif
 proceduresetselection spot,spot+length(searchFor)

See Also


History

VersionStatusNotes
10.0NewNew in this version.