DELETE
Delete Program Statements
This directive removes statements from a program. You can use it in Thoroughbred Basic Console Mode and Thoroughbred Basic Run Mode.
Syntax
Section titled “Syntax”DELETE [line-ref1 [, line-ref2]]
DELETE [, line-ref2]line-ref1- is a statement label or line number that specifies the first program line to be removed from the program. The default is 1.
line-ref2- is a statement label or line number that specifies the last line to be removed from the program. This cannot reference a line below line-ref1. If not specified and the comma is used, defaults to 65534; if not specified and no comma is used, defaults to line-ref1 value.
Remarks
Section titled “Remarks”Only the copy of the program in the task memory is altered. The copy of the program stored on disk is not altered until the program in task memory is SAVEd.
One program statement or a range of statements can be removed.
If line-ref1 is greater than line-ref2, an ERR=45 results.
If line-ref1 does not exist in the program, the next highest line in the program or line-ref2, whichever is less, is the first to be DELETEd.
If line-ref2 does not exist in the program the next lowest line in the program or line-ref1, whichever is higher, is the last to be DELETEd.
If an attempt is made to DELETE portions of an ENCRYPTed or PSAVEd program, an ERR=18 results. DELETEing the entire program does not create an error.
Examples
Section titled “Examples”DELETEremoves all program statements from the task memory area.
DELETE 123removes program statement 123 only.
DELETE 123 ,removes all statements from and including 123 through 65534.
DELETE 123 , 350removes all program statements from and including 123 through and including 350.
DELETE , 350removes all program statements from and including 1 through and including 350.
PRINT LST (CPL ("DELETE"))shows how Thoroughbred Basic sets the default program line numbers when it PRINTs:
00000 DELETE 00001,65534
See also
Section titled “See also”RENAME directive
From the Thoroughbred Basic Language Reference, Volume I: A–E, version 8.9.1. Open this page in the PDF