Sharp OZ-707 Operation Manual - Page 70

Format, Purpose, Remarks, Example

Page 70 highlights

EOF p o FORMAT: EOF (file number) Abbreviation: EO. See Also: PURPOSE: Determines if the end of a sequential file has been reached. REMARKS: The EOF function checks if all data in a sequential file (with the specified file number) has been read. If all data has been read, EOF returns -1 (true) as its function value. If not, EOF returns 0 (false). For the device name COM, EOF returns -1 (true) if the 20-character buffer is empty and 0 (false) if not. An error occurs if a file with the specified number has not been opened for input. EXAMPLE: 10: OPEN "E:A" FOR OUTPUT AS #2 20: PRINT #2, 123,456,789 30: CLOSE 40: OPEN "E:A" FOR INPUT AS #2 50: INPUT #2,A,B 60: X = EOF (2) 70: INPUT #2 ,C 80: Y = EOF (2) 90: CLOSE:END [60] Not all data has been read in this line. X = o. [SO] All data has been read. Y = -1 . ERASE p o FORMAT: ERASE array 1 [, array 2, ... array n] Abbreviation: ER. See Also: CLEAR, DIM PURPOSE: Erases specified arrays. REMARKS: Array elements cannot be erased individually; the whole array is cleared and its memory area is freed. To re-define an array size, first ERASE it and then re-specify it in a DIM statement. Double-precision array variables can be specified. The contents of double-precision variables specified using the DEFDBL command are erased, but the DEFDBL mode is not. Do not use the ERASE command within a FOR...NEXT loop. EXAMPLE: 10: DIM AA(10) 200: ERASE AA 128 129

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128

EOF
FORMAT:
EOF (file number)
Abbreviation:
EO.
See
Also:
PURPOSE:
Determines if the end of a sequential file has been reached.
REMARKS:
The EOF function checks if all data
in
a sequential file (with the
specified file number) has been read.
p
o
If all data has been read, EOF returns
-1
(true)
as
its function value. If
not, EOF returns 0 (false). For the device name COM, EOF returns
-1
(true) if the 20-character buffer
is
empty and 0 (false)
if
not.
An error occurs if a file with the specified number has not been opened
for input.
EXAMPLE:
10: OPEN
"E
:
A"
FOR
OUTPUT
AS
#2
20: PRINT
#2,
123,456,789
30: CLOSE
40: OPEN "E:A"
FOR
INPUT
AS
#2
50: INPUT
#2
,
A,B
60: X
=
EOF
(2)
70: INPUT
#2
,C
80: Y
=
EOF
(2)
90: CLOSE:END
[60] Not all data has been read in this line. X
=
o.
[SO]
All data has been read. Y
=
-1
.
128
E
RASE
FORMAT:
ERASE array 1
[,
array 2,
...
array
n]
Abbreviation:
ER.
See
Also:
CLEAR,
DIM
PURPOSE:
Erases specified arrays.
REMARKS:
Array elements cannot
be
erased individually; the whole array is
cleared and its memory area is freed. To re-define an array size, first
ERASE it and then re-specify it
in
a
DIM
statement.
Double-precision array variables can be specified. The contents of
double-precision variables specified using the DEFDBL command are
erased, but the DEFDBL mode
is
not.
Do
not use the ERASE command within a FOR ... NEXT loop.
EXAMPLE:
10:
DIM
AA(10)
200: ERASE
AA
129
p
o