Running Programs
Editing Programs
Fundamental Statements
Branches, Loops, and Subroutines
Program Timers
Arrays
Strings
User Defined Functions
Storing and Retrieving Data
Program Calls
Local and Global Declarations
Formatting Output
Debugging Operations
Numeric Functions
String Functions
Print Functions
TIME Mode Commands
- RUN
- Begins program execution.
- ATTN
- Interrupts program execution.
- CONT
- Restarts program execution after ATTN or STOP.
[To Contents]
- LIST, PLIST
- Lists program file to display or printer.
- FETCH
- Fetches specific lines of program file.
[To Contents]
- LET
- Assigns values to variables.
- END
- Terminates program and deallocates the program.
- STOP
- Inerrupts program execution without deallocation.
- WAIT
- Interrupts program execution for a specified period of time.
- REM, !
- Delimits program remarks.
- DISP, PRINT, TAB
- Displayorprintinformation.
- INPUT
- Allows input of data from the keyboard.
[To Contents]
- GOTO
- Unconditionally branches to a line number.
- IF...THEN...ELSE
- Tests condition and branches.
- FOR-NEXT, STEP
- Repeatedly executes a series of statements a predetermined number of times.
- GOSUB-RETURN
- Branches to a series of statements and returns
- ON...GOTO
- Branches to the line numberdetermined by the value of the included expression.
- ON...GOSUB
- Branches to the subroutine determined by the value of the included expression.
- POP
- Bypasses a pending subroutine return.
[To Contents]
- ON TIMER #
- Sets a program timer.
- OFF TIMER #
- Disables a program timer.
- ON TIMER # GOTO
- Branches to a statement when a timer goes off
- ON TIMER # GOSUB
- Branches to a subroutine when a timer goes off
[To Contents]
- OPTION BASE
- Defines the lower bound of all arrays in a program.
- DIM, REAL, SHORT, INTEGER
- Declare and dimension arrays.
[To Contents]
String Variables
String Identifier: letter[digit]$
Dimensioning a String: DIM string identifier [subscript]
Default size of a string variable is 32 characters.
Substring Identifier: letter[digit]$[subscript[,subscript]]
Two subscripts separated by a comma specify beginning and ending character positions, respectively. A
single subscript specifies a beginning character-the substring extends to the end of the string.
String Expressions
A string expression can take any of the following forms:
- A string constant.
- A string variable.
- A substring.
- A string function.
- A string expression consisting of any concatenation of the above using the & operator.
String Functions
The parameters S$ and T$ can be any string expression.
LEN(S$) | UPRC$(S$) |
POS(S$,T$) | KEY$ |
VAL(S$) | CAT$(file number) |
STR$(numeric expression) |
[To Contents]
- DEF FN
- Defines a single-line user-defined function or the first line of a multiline function.
- LET FN
- Assigns a value to the function in a multiline function.
- END DEF
- Labels the end of a multiline function.
[To Contents]
Within a Program
- DATA
- Statement Contains numeric or string constants for use by READ.
- READ
- Assigns values from DATA statements to variables.
- RESTORE
- Resets the data pointer to the first or specified DATA statement in the file.
From Data Files
- ASSIGN #
- Associates a file number with a file name.
- PRINT #
- Stores data items in a data file.
- READ #
- Retrieves data items from a data file.
- RESTORE #
- Resets the data pointer to the first or specified line of a data file.
[To Contents]
- CALL
- Calls a program from within another program. Execution returns to the calling program at the line after the CALL statement when the called program ends.
[To Contents]
A global declaration is an HP-75 setting that remains in effect until:
- The setting is changed by a new declaration, executed either from the keyboard or from a running program.
- The HP-75 is reset.
Local | Global |
DATA | ALARM OFF, ALARM ON |
DEF FN, LET FN, END DEF | ASSIGN IO, OFF IO, RESTORE IO |
DIM | ASSIGN # |
INTEGER, SHORT, REAL | BEEP OFF, BEEP ON |
IMAGE | DEFAULT OFF, DEFAULT ON |
LET | DEF KEY |
OFF ERROR, ON ERROR | DELAY |
ON TIMER # | DISPLAY IS, PRINTER IS |
OPTION BASE | ENDLINE |
| LOCK |
| MARGIN |
| OFF TIMER # |
| OPTION ANGLE DEGREES |
| OPTION ANGLE RADIANS |
| STANDBY ON, STANDBY OFF |
| TRACE FLOW, TRACE VARS, TRACE OFF |
| WIDTH, PWIDTH |
A local declaration affects only keyboard calculations or the program in which the declaration occurs.
[To Contents]
- IMAGE
- Specifies the output format for DISP USING and PRINT USING statements.
- DISP USING
- Displays information according to the specified IMAGE statement or the included format string.
- PRINT USING
- Prints information according to the specified IMAGE statement or the included format string.
[To Contents]
- TRACE FLOW
- Traces program flow. Shows all branches in program execution.
- TRACE VARS
- Traces variables. Shows all changes in values of variables.
- TRACE OFF
- Turns off all trace operations.
- ON ERROR
- Initiates user-defined error trapping.
- OFF ERROR
- Disables user-defined error trapping.
- ERRN
- Displays error number of last error.
- ERRL
- Displays line number where last error occurred.
[To Contents]
Given the appropriate number of arguments and type of arguments (numeric or string expressions), each
numeric function returns a single numeric constant.
- ABS(X)
- Absolute value of X
- ACOS(X)
- Arccosine of X, in Quadrant I or II.
- ANGLE(X,Y)
- Arctangent of Y/X, in proper quadrant. That is, returns the angle theta formed between the x-axis and the point (x,y), such that -pi < theta <= pi.
- ASIN(X)
- Arcsine of X, in Quadrant I or IV.
- ATN(X)
- Arctangent of X, in Quadrant I or IV.
- CEIL(X)
- Smallest integer >=X (abbreviation ce).
- COS(X)
- Cosine of X.
- COT(X)
- Cotangent of X.
- CSC(X)
- Cosecant of X.
- DATE
- The date in yyddd format based on the clock setting.
- DEG(X)
- Radian-to-degree conversion of X.
- EPS
- Smallest machine number (1.E-499).
- ERRL
- The line number of the most recent error or warning.
- ERRN
- The identification number of the most recent error or warning (abbreviation er).
- EXP(X)
- e^X.
- FLOOR(X)
- Same as INT(X) (abbreviation fl)
- FP(X)
- Fractional part of X.
- INF
- Largest machine number (9.99999999999E499).
- INT(X)
- Largest integer <= X.
- IP(X)
- Integer part of X.
- LEN(S$)
- The length of string S$.
- LOG(X)
- Natural logarithm of X, X>0.
- LOG10(X)
- Log to the base 10 of X, X>0 (abbreviation lo).
- MAX(X,Y)
- If X > Y then X, else Y.
- MEM
- The number of bytes of available memory.
- MIN(X,Y)
- If X < Y then X, else Y.
- MOD(X,Y)
- X modulo Y:X-Y*INT(X/Y).
- NUM(S$)
- The decimal code of the first character of S$.
- PI
- 3.14159265359.
- POS(S$,T$)
- Searches string S$ for the first occurrence of T$. Returns the starting position if found; 0 if not.
- RAD(X)
- Degree-to-radian conversion of X.
- RES
- The last numeric result to be displayed or printed.
- RMD(X,Y)
- Remainder of X/Y: X-Y*IP(X/Y).
- RND
- Next number, R. in sequence of pseudo-random numbers, 0 <= R < 1.
- SEC(X)
- Secant of X.
- SGN(X)
- Thesignof X: -1 if XX=0, 1 if X>0.
- SIN(X)
- Sine of X.
- SQR(X)
- Positive square root of X.
- TAN(X)
- Tangent of X.
- TIME
- The number of seconds since midnight of the current day.
- VAL(S$)
- Returns the numeric value of a string composed of digits, decimal point, and/or exponent.
[To Contents]
String functions return zero or more characters of information.
- CAT$(X)
- The catalog entry of the specified file, 32 characters in length. Files are numbered in order of their appearance in the system catalog. CAT$(0) returns the catalog of the current EDIT file. For X<0. CAT$(X) returns the catalog of the currently initialized BASIC file, if any (abbreviation c).
- CHR$(X)
- The character whose decimal code is MOD(X,256) (abbreviation ch).
- DATE$
- The date in a yy/mm/dd format.
- KEY$
- The display character of the currently depressed key or keystroke combination. Returns the null string if no key is depressed (abbreviation k).
- STR$(X)
- The string information contained in the digits, decimal point, sign, and exponent of X.
- TIME$
- The time in a hh:mm:ss format, using 24-hour notation (abbreviation ti).
- UPRC$(S$)
- Converts S$ to all uppercase letters (abbreviation upr).
- VER$
- A six-character string indicating the operating system version.
[To Contents]
- TAB(X)
- Causes the following DISP or PRINT item to be output beginning at column X, where column 1 is the left margin.
[To Contents]
The following commands are nonprogrammable and executable in TIME mode only.
- ADJST
- Displays the ADJST template that's used to adjust the clock setting.
- EXACT
- Sets a timing mark for clock calibration.
- RESET
- Clears previous EXACT marks and the current speed adjustment factor.
- SET
- Displays the set-time template that's used to set the system clock.
- STATS
- Displays the STATS template that's used to specify month/day and hour display formats and to specify the YEAR or the EXTD (extended) calendar in APPT mode.
[To Contents]