replaceText

Replaces a part of a section with a block of text.

Syntax
aSourceFile replaceText (aSection, startLine, startColumn, endLine, endColumn, block)
Parameters
aSection - Integer
The section to edit.
startLine - Integer
The line number of the beginning of the selection.
startColumn - Integer
The column of the beginning of the selection.
endLine - Integer
The line number of the end of the selection.
endColumn - Integer
The column of the end of the selection.
block - TextBlock
The block to insert.
Remarks

This method ignores the read-only status of the text file owning this section. It is always possible to perform a replace.

The start and end position does not have to be ordered. If the start position is after the end, the positions are switched automatically.

The text positions are automatically fixed to be within bounds.

This is the main method for all text edits.

  • To insert text, just use the same start and end positions.
  • To delete text, just use an empty block.