Language Elements

BASIC-80

Table 2-3. BASIC-80 Functions (Cont'd.)

Functions

Returns

Example

 

 

 

DSKF

Number of 128-byte sectors free on disk or

DSKF(X)

 

drive (X)

 

EOF

-1 if end-of-file; 0 if not (for file X).

A = EOF(X)

ERL

Line number of last error.

ERL

ERR

Error code of last error.

ERR

EXP

e to the (X)th power.

EXP (X)

FIX

Integer value of (X).

FIX (X)

FRE

Number of bytes in memory (X) or number of

FRE (X)

 

bytes in string space (X$)

 

HEX$

String equal to hex value of (X%)

HEX$(X%)

INP

Reads a byte from port (X)

INP(X)

INPUT$

Inputs (X) characters from file (Y)

INPUT$ (X, Y)

INSTR$

Position of (X$) within (Y$)

INSTR$ (X$, Y$)

INT

Integer value of (X)

INT(X)

LEFT$

Leftmost (X) characters of (A$)

LEFT$ (A$, X)

LEN

Character length of (X$)

LEN (X$)

LOC

Current record number in random file X.

LOC (X)

 

Sectors read or written since last OPEN in se-

 

 

quential file X.

 

LOF

Number of records in random file X. Number of

LOF (X)

 

data sectors in sequential file X.

 

LOG

Natural log of (X)

LOG (X)

MID$

J characters, starting at I, of string A$

MID$ (A$, I, J)

MKD$

B-byte string equal to double-precision

MKD$ (A$)

 

floating-point variable (X!)

 

MKI$

2-byte string equal to integer variable (X%)

MKI$ (A$)

MKS$

4-byte string equal to single-precision

MKS$(A$)

 

floating-point variable (X!)

 

OCT$

Octal equivalent of decimal argument

OCT$(X)

PEEK

Single byte from memory location (X)

PEEK (X)

POS

Position of cursor after last PRINT.

POS (dummy argument)

RIGHT$

Rightmost (1%) characters of X$

RIGHT$ (X$, 1%)

RND

Single-precision random number between 0

RND

 

and 1.

 

SGN

Sign of (X)

SGN (X)

SIN

Sine of (X)

SIN (X)

SPACES

String of (1%) spaces

SPACE$(I%)

SPC

String of (X%) spaces

SPC(X%)

SQR

Square root of (X)

SQR (X)

STR$

String equal to (X)

STR$ (X)

STRING$

Character X, Y% times-or the first character

STRING$ (Y%, X)

 

of A$, Y% times.

STRING$ (Y%, A$)

TAB

Spaces to (X) position on terminal

TAB (X)

TAN

Tangent value of (X)

TAN (X)

USR

References user subroutine 0 to 24

AX = USR 12 (A1, A2)

VAL

Numerical value of (X$)

VAL (X$)

VARPTR

Memory address of (X)

VARPTR(X)

 

 

 

2-4

Page 14
Image 14
Intel 9800758-02 manual BASIC-80 Functions Contd