Sharp OZ-707 Operation Manual - Page 82

EXAMPLE, FORMAT, Abbreviation

Page 82 highlights

If the start position is specified using the LOCATE statement before excecuting the INPUT statement, the prompt string or ? will be displayed at the specified location. EXAMPLE: 10: INPUT A 20: INPUT "A=";A 30: INPUT "A=",A 40: INPUT "X=?";X,"Y=?";Y [10] Puts a question mark at the left margin. [20] Displays "~" and waits for data to be entered. [30] Displays "A=". When data is entered, "A=" disappears and the data is displayed starting at the left margin. [40] Displays "X=?" and waits for the first entry. After IENTER Iis pressed, "Y=?" is displayed at the left margin. 152 INPUT$ p o FORMAT: 1. INPUT$ (character count) 2. INPUT$ (character count, # file number) Abbreviation: 1.$ See Also: INPUT#, OPEN, PRINT# PURPOSE: Allows input of a character string with the specified number of characters from the keyboard or a file. REMARKS: Up to 255 characters can be specified as character count. Format 1 is used to enter a character string with the given number of characters from the keyboard. Execution automatically proceeds to the next statement after a string has been entered. The I. ' I or IENTER I key is also counted as one character. A symbol (e.g. I5MBL I W W 1; four keystrokes) is counted as one character. When entering a string from the keyboard, the OPEN command need not be executed. Format 2 reads a character string with the given number of characters from the file with the given file number. An error occurs if the specified file has not been opened. The INPUT$ command is valid only for a file which has been opened in the INPUT mode. Numerals are treated as characters when read. Since the INPUT$ command reads the specified number of characters, the data stored in the file must have the proper format readable by the INPUT$ command. EXAMPLE: 100: A$=INPUT$ (5, #5) 110: AB$=INPUT${20, #5) This program reads 5 characters into variable A$ and then 20 characters into variable AB$ via buffer No.5. 153

  • 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

If the start position is specified using the LOCATE statement before
excecuting the INPUT statement, the prompt string or
?
will
be
displayed at the specified location.
EXAMPLE:
10: INPUT A
20: INPUT "A=";A
30: INPUT "A=",A
40: INPUT "X=?";X,"Y=?";Y
[10]
Puts
a
question
mark
at
the left
margin.
[20]
Displays
"~"
and
waits
for
data
to
be
entered
.
[30]
Displays
"A=".
When
data
is
entered,
"A="
disappears
and
the
data
is
displayed
starting
at
the
left
margin.
[40]
Displays
"X=?"
and
waits
for
the
first
entry
.
After
I
ENTER
I
is
pressed,
"Y=?"
is
displayed
at
the
left
margin.
152
INPUT$
p
o
FORMAT:
1.
INPUT$ (character count)
2.
INPUT$ (character count,
#
file number)
Abbreviation:
1.$
See
Also:
INPUT#, OPEN, PRINT#
PURPOSE:
Allows input of a character string with the specified number of
characters from the keyboard or a file.
REMARKS:
Up to 255 characters can be specified
as
character count.
Format 1 is used to enter a character string with the given number of
characters from the keyboard. Execution automatically proceeds to the
next statement after a string has been entered.
The
I.
' I
or
I
ENTER
I
key
is
also counted
as
one character.
A symbol (e.g.
I
5MBL
I
W W
1; four keystrokes) is counted as one
character.
When entering a string from the keyboard, the OPEN command need
not be executed.
Format 2 reads a character string with the given number of characters
from the file with the given file number.
An
error occurs if the specified
file has not been opened.
The INPUT$ command
is
valid only for a file which has been opened
in
the INPUT mode.
Numerals are treated
as
characters when read.
Since the INPUT$ command reads the specified number of characters,
the data stored
in
the file must have the proper format readable by the
INPUT$ command.
EXAMPLE:
100: A$=INPUT$
(5,
#5)
110: AB$=INPUT${20,
#5)
This
program
reads
5
characters
into
variable
A$
and
then
20
characters
into
variable
AB$
via
buffer
No.5
.
153