Functions
Up

 

Home
Hardware
Software
Shareware
Manuals
Miscellaneous

Functions


Functions

Argument ranges are indicated below by special letters:

x: (-1 x 10E38, -1 x l0E - 38),(1 x l0E - 38,1 x 10E38)

c: (0,255)

n: (-32768,32767)

str: string argument

var: variable name

 

ABS(x) Computes absolute value.

Y = ABS(X)

 

ASC(str) Returns ASCII code of first character of string.

A = ASC(T$)

 

CHR$(c) Returns character for ASCII, control, or graphics code.

P$ = CHR$(T)

 

COS(numeric) Returns cosine of an angle given in radians.

Y = COS(7)

 

EXP(numeric) Returns natural exponential of number (Enumber)

Y = EXP(7)

 

INKEY$ Gets keyboard character if available.

A$ = INKEY$

 

INT(x) Returns largest whole number not greater than x.

Y = INT(X)

 

LEFT$(str,c) Returns left portion of string.

P$ = LEFT$(M$, 7)

 

LEN(str) Returns the number of characters in a string.

X = LEN(SEN$)

 

LOG (numeric) Returns natural logarithm.

Y = LOG(353)

 

MEM Finds amount of free memory.

PRINT MEM

 

MID$(str,pos,len) Returns a substring of another string. If length option is omitted, the entire string right of pos is returned.

PRINT MID$(A$, 3, 2)      F$=MID$(A$, 3)

 

PEEK(n) Gets value in location n (n = 0 to end of memory).

V = PEEK(18520)

 

POINT(x,y) Tests whether specified graphics cell is on or off, x (horizontal) = 0 - 63; y (vertical) = 0 - 31. The value returned is -1 if the cell is in the character mode, 0 if it is off, or the color code if it is on. See CLS for color codes.

IF POINT (13,35) THEN PRINT 'ON'

 

RIGHT$(str, c) Returns right portion of string.

ZIP$ = RIGHT$(AD$, 5)

 

RND(n) Generates a "random" number between 1 and n if n> 1, or between 0 and 1 if n = 0.

V = RND(100)      PRINT RND(0)      R = RND(X)

 

SGN(z) Returns sign component: -1,0,1, if x is negative, zero, positive.

X = SGN(A*B)

 

SIN(x) Computes sine; angle must be in radians.

Y = SIN(X)

 

STR$(x) Converts a numeric expression to.a string.

S$ = STR$(X)

 

SQR (numeric) Returns the square root of a number.

V = SQR(5+3)

 

TAN (numeric) Returns tangent of angle given in radians.

Y = TAN(45.7)

 

USR (n) Returns the result of a machine language routine call.

Y = USR(-3144)
** Store address of routine in 16918,16919

 

VAL(str) Evaluates a string as a number.

V = VAL("100 DOLLARS")

 

VARPTR(str)  Returns the storage location in memory of a string.

V = VARPTR("100 DOLLARS")      V = VARPTR(A$)