EasyManuals Logo
Home>IBM>Laptop>5100

IBM 5100 Basic Reference Manual

IBM 5100
187 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #91 background imageLoading...
Page #91 background image
(
(
(
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

Table of Contents

Other manuals for IBM 5100

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM 5100 and is the answer not in the manual?

IBM 5100 Specifications

General IconGeneral
BrandIBM
Model5100
CategoryLaptop
LanguageEnglish

Related product manuals