Download Print this page

Radio Shack TRS-80 PC-2 Owner's Manual page 14

Hide thumbs Also See for TRS-80 PC-2:

Advertisement

INPUT$ does not attempt to evaluate input as an
arithmetic expression but treats it strictly as a charac-
ter string.
INPUT$ is effective if, and only if. KI has been routed to
the RS-232C via a SETDEV command (that is, SETDEV
KI has been specified so that data requests normally filled
from the keyboard are filled from the RS-232C).
It is used with the same general syntax as INPUT, the only
restriction being that the INPUT$ variable must be a
string variable.
If INPUT$ has a quotated string prompt, as in INPUT$
"LOAD DATA"; A$, the prompt is handled in accord-
ance with any current display output (DO) routing.
For example, enter a command sequence similar to the
following:
100 SETDEV KI
110 INPUT$ A$
INPUT%
Fill a String Array with RS-232C Data
INPUT% "prompt"; variable
prompt is the message you want displayed.
prompt is optional; if omitted, a question
mark (7) will be displayed.
variable represents the data to the typed in and
must be a dimensioned string variable.
INPUT% is another variant of BASIC's INPUT function.
Its sole function is to load an entire array of non-numeric
data from the RS-232C.
22
INPUT% is effective if, and only if, KI has been routed to
the RS-232C via a SETDEV command (that is, SETDEV
KI has been specified so that data requests normally filled
from the keyboard are filled from the RS-232C).
The syntax of an INPUT% statement takes the same form
as for BASIC's normal INPUT, with the single exception
that the variable must be a dimensioned string variable in
the form A$ (*).
Any prompt supplied with INPUT% is not processed
according to the current DO routing, but is always dis-
played.
When INPUT% is executed, consecutive characters receiv·
ed from the RS-232C port are placed in consecutive array
elements in row-major order, with each array element
being filled to its maximum dimensioned length from left
to right.
INPUT% execution stops when:
• a carriage return is received
• the array is full.
Array elements which are not filled during INPUT% are
nulled (set to"
H).
For example, to declare a string array Z$ as having three
rows and four columns of two-character elements, then
fill that array from RS-232C input, enter a command
sequence similar to the following:
100 DIM Z$ (4,3)
*
2
110 SETDEV KI
120 INPUT% "RECEIVING ARRAY"; Z$
23

Advertisement

loading