HTBasic Help
×
Menu
Index

GET

Loads LIF, DOS or UNIX ASCII program file into memory.
 
 GET file-specifier [,append [,run]]
 
Usage:
GET Modprog$,250,20
GET "D:CODEFILE"
GET "Sdir/Cdir/Pdir/CorFile"
GET "GMAT.BAS"
 
Example: GET.BAS
 
Description:
When a GET is attempted, the first program line is read from the file and checked for a line number. If no line number exists, an error is reported. If GET is executed from a running program, this error can be trapped just like any other error. If the first line of the ASCII file has a valid line number, then the GET operation first deletes the current program and variables (except for COM variables) and then attempts to read the ASCII program lines into memory. Each line is syntax checked as normal. If a syntax error is found, the line is listed to the PRINTER IS device, turned into a comment (by adding "!* " after the line number) and then saved in memory with the other program lines.
 
If GET specified an append line, then the current program is deleted starting at the append-line; the new lines are appended to the current program and are renumbered to start at the append line number. If GET did not specify an append line, then the program is read in without renumbering.
 
If GET specifies a run line (line must be in main context), execution resumes automatically at the run line after a prerun. If GET, executed from a program, does not specify a run line, execution resumes at the beginning of the program. If GET, executed from the keyboard, does not specify a run line, a RUN command must be given to start execution. If a syntax error occurred during the GET, the error is reported and no RUN takes place. These errors cannot be trapped.
 
GET has been extended to read programs in many different formats: LIF ASCII, DOS ASCII, UNIX ASCII, Viper-I ASCII and Viper-II ASCII. In DOS and UNIX ASCII files, carriage-returns (CR) are ignored and line-feeds (LF) are used to terminate lines. Program lines can be terminated with LF, CR/LF or LF/CR. Files that are terminated with CR only can only be read after an LF is added at the end of each line.
 
See Also: