English
Language : 

NSB8 Datasheet, PDF (77/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
DISK FILES FUNCTIONS
TYP (<numeric expression>)
This function returns as its value a number which indicates the type (numeric = 2, string = 1, end of
file = 0) of the next data item in the open disk file with open file number given by the value of the
function’s argument. See section FILES for details.
FILE (<string expression>)
Returns a number corresponding to the type of the file specified by the <string expression>, which
must evaluate to a legal disk file name as defined in section FILES. If the argument is not a legal file
name, or is not the name of a disk file on a currently loaded diskette, then the value -1 is returned.
Assuming that “ABC.B” is the name of a BASIC program file on a disk in drive 2, then FILE
(“ABC.B,2”) will return the value 2.
MISCELLANEOUS FUNCTIONS
RND (<numeric expression>)
This function returns a pseudo random numeric value between 0 and 1. The number generated is
dependent upon the previous number generated by the function. The very first number in the
sequence is called the seed, or starting value. If the value of the argument is negative, BASIC selects
a random seed (based upon the status of the disk system), and computes the value of the function from
it. The randomizing effects of using RND with a negative argument are enhanced if user input is
requested between the last disk access and the negative call to RND. If the argument evaluates to 0,
the previously computed value is used to generate another pseudo random value in the sequence. If
the argument reduces to a value between 0 and 1, this number is used as the new seed, the sequence
is restarted, and the first value generated from the new seed is returned as the value of the
function. The following program will set a random seed and then print 10 pseudo random values:
10 J=RND(-1)
20 FOR J=1 TO 10
30 PRINT RND(0)
40 NEXT
EXAM (<numeric expression>)
The EXAM function returns the contents of the computer memory byte addressed by the value of the
<numeric expression>. The argument should evaluate to an integer from 0 to 65535. The value
returned will be numeric, an integer from 0 to 255.
FREE (<numeric expression>)
Returns the current total number of bytes remaining in the BASIC memory for additional user
program or data. Free storage, as this memory area is called, is also used for internal bookkeeping
storage and storage of temporary values used by BASIC, such as string values during concatenation. The
argument value, as long as it is numeric, is ignored, and most programmers use 0.
NSB8
Rel. 5.10
Page 65