Negative File Numbers - IBM 5100 Basic Reference Manual

Hide thumbs Also See for 5100:
Table of Contents

Advertisement

(
(
(
Negative File Numbers
Negative file numbers can be used to create a type 2 general interchange (source or
data) file that can then be processed by BASIC or APL. The following rules control
the use of negative file numbers.
• The negative number must first be assigned to a variable. Negative constants can-
not be entered directly in the OPEN statement as file numbers. For example:
10 F =-1
20 OPEN FL2, 'E80', F, OUT
• Each statement in the created file (source or data) must end with hexadecimal
X'E3'. This specification is the internal code recognized as end of line by the
5100. The X'E3' is provided automatically if PUT or MAT PUT is used to write
the file. The X'E:3' must be specified by the program if PRINT is used to write
the file.
The following example shows a single file creation with a negative file number:
10 F =-1
20 OPEN FL2, 'E80', F, OUT
30A$= X'E3'
40 PRINT FL2, '0090 PRINT &PI, &E'; A$;
50 CLOSE FL2
In this example, file reference FL2 will contain file number -1, which consists of
the single statement to display &PI and &E. Hexadecimal constant X'E3' is
assigned to A$, which ends the source statement (40).
Notes About OPEN
• An OPEN statement must be issued before a GET, MAT GET, PRINT, MAT
PRINT, PRINT USING, MAT PRINT USING, PUT, or MAT PUT statement
that references the file reference code (FLO-FL9) specified in the OPEN statement.
• If a file is already open, the OPEN statement causes an error message.
• Once a file is open, do not remove the tape cartridge until the file is closed.
• A quote cannot be embedded in a character constant used for a user I D.
87

Advertisement

Table of Contents
loading

Table of Contents