proceduresetselection
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

- info("procedureselectedtext") -- returns the selected source code in the current procedure window.
- info("procedureselectionend") -- returns the ending position of the selected source code in the current procedure window.
- info("procedureselectionlength") -- returns the length of the selected source code in the current procedure window.
- info("procedureselectionstart") -- returns the starting position of the selected source code in the current procedure window.
- info("proceduretext") -- returns the source code in the current procedure window.
- procedureinsertfieldname -- inserts a field name into a procedure, adding chevrons if necessary.
- procedureinsertformname -- inserts a form name into a procedure, adding quotes.
- procedureinsertprocedurename -- inserts a procedure name into a procedure, adding quotes if necessary.
- procedureinserttext -- inserts text into the current procedure.
- proceduresearch -- searches for text in a procedure.
- proceduresearchexact -- searches for text in a procedure.
- proceduresearchnext -- searches for text in a procedure, starting from the current location.
- proceduresearchnextexact -- searches for text in a procedure, starting from the current location.

History

Version | Status | Notes
10.0 | New | New in this version.