HTBasic Help
×
Menu
Index

Command Line Execution

 

Keyboard vs Program Execution

Most HTBasic Keywords can be executed either from the Keyboard or from a Program (as well as referenced in IF...THEN statements). However, the following commands can only be executed from the keyboard command line:
 
CHANGE, CONT, COPYLINES, DEL, EDIT, EDIT KEY, FIND, HELP, INDENT, MOVELINES, REN, RUN, SCRATCH A/ALL, SCRATCH BIN, SCRATCH COM, SCRATCH RECALL, SECURE, STORE SYSTEM, XREF
 

HTBasic Commands

You can enter HTBasic commands on the Editor or Run Screen command line for immediate execution. Expressions are evaluated and their results displayed in the message line. For legacy editor support, program lines may be entered with a line number to specify insertion point. Lines longer than 63 characters are truncated (whereas lines on the edit screen can be up to 255 characters long). If a syntax error is detected in a program line, an error message is displayed in the system message line and the cursor is positioned over the error. You can execute HELP keyword as an immediate command to display the Reference Manual entry for that statement's keyword to determine how to correct the syntax error.
 
Here are some examples of command line statements for immediate execution and program line insertion:
 
INDENT             !command
PI*2               !expression
100 FOR J=1 TO 5   !program line
 
Any statement you enter without a line number will be evaluated or executed as an immediate command. Some commands, however, have more than one meaning. For example, if you enter X<4 from the command line, HTBasic will display a 1 or 0 for its logical value. However, if you enter X=4, this will be treated as the more commonly intended assignment operation rather than a logical comparison. To force a logical comparison, enter it in parenthesis: (X=4).
 

EXECUTE Windows Commands

EXECUTE [command] executes a Windows command or executable (.exe) program. For example:
 
EXECUTE "sol.exe"
EXECUTE "dir"
 
When the command has completed, control is returned to HTBasic.
 
If no command argument is specified, the Windows command interpreter is invoked and you are given a prompt so you can issue one or more commands. You must then type "EXIT" to terminate the command interpreter and return to HTBasic.
 
If no WAIT OFF option is specified, the message "Hit any key to continue" will be displayed after the command has completed execution.
 
If WAIT OFF is specified, control immediately returns to the next HTBasic statement.
 
If the RETURN option is specified, the executed program’s termination error value is returned in the numeric variable.
 
When control is returned to HTBasic, an attempt is made to service any events that occurred while the command interpreter had control. Some events may be lost or ignored during this time period.