
7-6
Section
Details of BASIC Commands
164
input$
Syntax:
INPUT
$ (<numerical expression> [, #<port expression>])
Description:
Function Reads a string of characters from the specified port.
<numerical expression> is an integer expression indicating the number of input characters to be
accepted. The valid range is : [1…255]. The system will wait until the specified number of
characters has been input. The result is the specified number of characters.
<port expression> is an expression returning an integer in the range: [1… 3].
All characters, excluding
CTRL
-
X
, can be read using
INPUT
$. (I
NPUT
$ can read the CR and LF
codes which cannot be read by the I
NPUT
and
LINE INPUT
statements.)
Remarks:
Note:
1.
If the port expression is not specified the terminal port is default.
2.
Port #3 corresponds to the terminal port of the ASC31.
3.
If Port #3 is specified on the ASC11 or ASC21, an “ILLEGAL FUNCTION CALL”
error (code B005) will result.
4.
If an interrupt occurs while the INPUT$ function is waiting for an input and the
interrupt is not disabled or stopped, the interrupt subroutine will be processed
immediately. Program execution will resume from the INPUT$ command when the
interrupt subroutine has been completed.
5.
Execution of the BASIC program will be paused and the BASIC LED indicator on
the front of the Unit will blink slowly until the specified number of characters has
been input.
Examples:
> 10 OPEN #1, "TERM:"
> 20 A$ = INPUT$(10,#1)
> 30 PRINT A$
See also:
WAIT
instr
Syntax:
INSTR
([<numerical expression>,] <string expression 1>,<string expression 2>)
Description:
Function Returns the position of the first occurrence of one string within another string.
<numerical expression> is the starting position in the string to be searched. Valid range: [1…255].
<string expression 1> is the string to be searched.
<string expression 2> is the desired string.
If the starting position is omitted then the search will begin from the first character of the string to
be searched. If the starting position is greater than the length of the search string then 0 is
returned. If the desired string cannot be found, 0 is returned. If the desired string is null, the result
of the function is 1 or the starting position, if specified.
If <string expression 1> is null, 0 will be returned.
Remarks:
Note:
1.
The search is case sensitive. This means the function differentiates between upper
and lower case strings.
Examples:
> 10 A = INSTR(2, “HELLO WORLD”, “WORLD”)
> 20 PRINT A
> RUN
7
See also:
Summary of Contents for C200H-ASC11
Page 1: ...C200H ASC11 ASC21 ASC31 ASCII Units Operation Manual Revised June 2000...
Page 2: ...iv...
Page 4: ...vi...