Returns the arc cosine, or inverse cosine (COS-1) of x. x must be in the range -1 to +1.
The number returned will be an angle in radians. To convert the angle to degrees, use the DEG function.
.ABS
a=ABS(x)
Returns the absolute value of a floating-point number - that is, without any +/- sign - for example ABS(-10.099) is 10.099
If x is an integer, you won't get an error, but the result will be converted to floating-point - for example ABS(-6) is 6.0.
Use IABS to return the absolute value as a long integer.
.ADDR
a%=ADDR(variable)
Returns the address at which variable is stored in memory.
The values of different types of variables are stored in bytes starting at ADDR(variable).
See PEEK for details.
.ALERT
any of: r%=ALERT(m1$,m2$,b1$,b2$,b3$)r%=ALERT(m1$,m2$,b1$,b2$)r%=ALERT(m1$,m2$,b1$)r%=ALERT(m1$,m2$)r%=ALERT(m1$)
Presents an alert dialog with the messages and keys specified, and waits for a response. m1$ is the message to be displayed on the first line, and m2$ on the second line.
If m2$ is not supplied or if it is a null string, the second message line is left blank.
Up to three keys may be used. b1$, b2$ and b3$ are the strings (usually words) to use on the keys. b1$ appears over an Esc key, b2$ over Enter, and b3$ over Space.
This means you can have Esc, or Esc and Enter, or Esc, Enter and Space keys. If no key strings are supplied, the word CONTINUE is used above an Esc key.
The key number - 1 for Esc, 2 for Enter or 3 for Space - is returned.
.APPEND
APPEND
Adds a new record to the end of the current data file. The record which was current is unaffected. The new record, the last in the file, becomes the current record.
The record added is made from the current values of the field variables A.field1$, A.field2$, and so on, of the current data file.
If a field has not been assigned a value, zero will be assigned to it if it is a numeric field, or a null string if it is a string field.
To overwrite the current record with new field values, use UPDATE.
.ASIN
a=ASIN(x)
Returns the arc sine, or inverse sine (SIN-1) of x. x must be in the range -1 to +1.
The number returned will be an angle in radians. To convert the angle to degrees, use the DEG function.
.APP
APP name ...ENDA
Begins definition of an OPA. name gives the name of the OPA.
.ASC
a%=ASC(a$)
Returns the character code of the first character of a$.
If a$ is a null string ("") ASC returns the value 0.
.AT
AT x%,y%
Positions the cursor at x% characters across the text window and y% rows down. AT 1,1 always moves to the top left corner of the window.
Initially, the window is the full size of the screen (extending from 1,1 to 40,9), but you can change its size and position with the SCREEN command.
.ATAN
a=ATAN(x)
Returns the arc tangent, or inverse tanget (TAN-1) of x.
The number returned will be an angle in radians. To convert the angle to degrees, use the DEG function.
.BACK
BACK
Makes the previous record in the current data file the current record.
If the current record is the first record in the file, then the current record does not change.
.BEEP
BEEP time%,pitch%
Sounds the buzzer. The beep lasts for time%/32 seconds - so for a beep a second long make time%=32, etc. The maximum is 3840 (2 minutes).
The pitch (frequency) of the beep is 512/(pitch%+1) KHz. BEEP 5,300 gives a comfortably pitched beep.
If you make time% negative, BEEP first checks whether the sound system is in use (perhaps by another OPL program), and returns if it is. Otherwise, BEEP waits until the sound system is free.
.BREAK
BREAK
Makes a program performing a DO...UNTIL or WHILE...ENDWH loop exit the loop and immediately execute the line following the UNTIL or ENDWH statement.
.BUSY
BUSY str$,c%,delay%BUSY str$,c%BUSY str$BUSY OFF
BUSY str$ displays str$ in the bottom left of the screen, until BUSY OFF is called. Use this to indicate `Busy' messages, usually when an OPL program is going to be unresponsive to keypresses for a while.
If c% is given, it controls the corner in which the message appears:
c% corner
0 top left
1 bottom left (default)
2 top right
3 bottom right
delay% specifies a delay time (in half seconds) before the message should be shown.
The string to display can be up to 19 characters long.
.CALL
e%=CALL(s%,bx%,cx%,dx%,si%,di%)
This function enables you to make operating system calls.
.CHR$
a$=CHR$(x%)
Returns the character with character code x%.
.CLOSE
CLOSE
Closes the current file (that is, the one which has been OPENed and most recently USEd).
If you've used ERASE to remove some records, CLOSE recovers the memory used by the deleted records, provided it is held either in the internal memory or on a Ram SSD.
.CLS
CLS
Clears the contents of the text window. The cursor then goes to the beginning of the top line. If you have used CURSOR OFF the cursor is still positioned there, but is not displayed.
.CMD$
c$=CMD$(x%)
Returns the command-line arguments passed when starting a program. Null strings may be returned. x% should be from 1 to 5. cmd$(2) to cmd$(5) are only for OPAs (OPL applications).
cmd$(1) returns the full path name used to start the running program.
cmd$(2) returns the full path name of the file to be used by an OPA application.
cmd$(3) returns "C" for "Create file" or "O" for "Open file".
If the OPA is being run with a new filename, this will return "C". This happens the very first time the OPA is used, and whenever a new filename is used to run it.
Otherwise, the OPA is being run with the name of an existing file, and cmd$(3) will return "O".
cmd$(4) returns the alias information, if any.
cmd$(5) returns the application name, as declared with the APP keyword.
See also GETCMD$.
.COMPRESS
COMPRESSsrc$,dest$
Copies data file src$ to another data file dest$. If dest$ already exists, the records in src$ are appended to the end of dest$.
.CONTINUE
CONTINUE
Makes a program immediately go to the UNTIL... line of a DO...UNTIL loop or the WHILE... line of a WHILE...ENDWH loop - i.e. to the test condition.
See also BREAK.
.COPY
COPY src$,dest$
Copies the file src$, which may be of any type, to the file dest$. Any existing file with the name dest$ is deleted. You can copy across devices.
Use the appropriate file extensions to indicate the type of file, and wildcards if you wish to copy more than one file at a time.
.COS
c=COS(x)
Returns the cosine of x, where x is an angle in radians.
To convert from degrees to radians, use the RAD function.
.COUNT
c%=COUNT
Returns the number of records in the current data file. This number will be 0 if the file is empty.
.CREATE
CREATEfile$,log,f1,f2,...
Creates a data file called file$. The filename may be a full file specification of up to 128 characters. Field names may be up to 8 letters/numbers.
The file may have up to 32 fields, as specified by f1, f2... (if viewed in the Database application, field f1 starts on the top line of the window, f2 is below it, etc.)
log specifies the logical file name - A, B, C or D. This is used as an abbreviation for the file name when you use other data file commands such as USE.
Immediately after the CREATE statement, the file is open and can be accessed.
CURSOR ON switches the text cursor on at the current cursor position. Initially, no cursor is displayed.
You can switch on a graphics cursor in a window by following CURSOR with the ID of the window. This replaces any text cursor. At the same time, you can also specify the cursor's shape, and its position relative to the baseline of text.
asc% is the ascent - the number of pixels (-128 to 127) by which the top of the cursor should be above the baseline of the current font. height% and width% (both from 0 to 255) are the cursor's height and width.
If you do not specify them, the following default values are used:
asc% = font ascent
height% = font height
width% = 2
An error is raised if id% specifies a bitmap rather than a window.