English
Language : 

NSB8 Datasheet, PDF (69/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
ITALIAN TECHNOLOGY
grifo®
WRITE
STATEMENT:
WRITE #<file number>, <expression list>
WRITE #<file number> %<random address>, <expression list>
ACTION:
Each value in the expression list is written to the diskette file to which the file number refers. If there
is more than one value in the expression list, the values are written sequentially (one after another)
in the order listed. After all the values in a WRITE statement’s expression list have been written to
the specified file, an endmark is written after the last item. Note that after any WRITE operation
which WRITEs and endmark, the file pointer will point to the endmark just written. In this way, new
data placed at the end of the file will overwrite old endmarks, and the result is that there is always
only one endmark in a file after proper sequential access. The programmer may opt to suppress the
writing of endmark by using the reserved word NOENMARK as the last item in the WRITE
statement. Writing may begin at any arbitrary point in the file if the random address, an offset
(calculated in bytes) from the start of the file, is included. Both the file number and the random
address may be any valid numeric expression, so long as the file number evaluates to an interger from
0 to 7 (corresponding to an opened file), and the random address is an interger between 0 an the last
byte address in the file. Any numeric expression in the expressionlist may be prefixed with an
ampersand (&) character. This signals BASIC to convert the vale to a single byteand WRITE in to
the file (any value so prefixed must evaluate to an interger from 0 to 255).
EXAMPLES:
90 WRITE #1, A, B, C$
75 WRITE #F, “HI THERE”, Q, X7 (B), NOENDMARK
80 WRITE # 0%P, R$
33 WRITE #X, &B1, &B2, &1
20 WRITE #3%Z (M), &E, NOENDMARK
30 WRITE #2% (R-1) *S, X$, Y$, Z$
REMARKS:
Even when & is used to cause writing of individual bytes, an endmark is still written after the values
in the expression list. Thus WRITE #1,&B will result in the writting of two bytes, the byte-
value of B and the endmark. When the intention is to write only a single byte using a single WRITE
statement, the NOENDMARK option should be exercised.
ERROR MESSAGES:
FILE ERROR
The diskette containing the specified file is write protected.
OUT OF BOUNDS ERROR
Either or both of the following conditions has occured:
1) The random access address is less than 0 or greater than the file’s highest permissible random
address.
2) The file number is not within the range of 0 to 7.
NSB8
Rel. 5.10
Page 57