41
Remarks:
All of the characters input from the end of the prompt to the carriage return are
assigned to the character variable as a series of data. (Comas and colons are
also treated as character data.)
A question mark is not displayed unless it is part of the prompt string.
The prompt statement is not displayed if a peripheral device other than TERM or
COMU is selected with the OPEN statement.
The character string is not assigned to the variable until the carriage return key is
pressed. Until then, the BASIC LED indicator on the ASCII Unit will blink indicat-
ing that the Unit is waiting for input of a carriage return.
If the port number is omitted, port 1 is assumed as the default port.
MID$ Statement
Purpose:
To replace a portion of one string with another string
Format:
MID$(<string 1>,<n>[,<m>]) = <string 2>
<string 1> is a string variable.
<n> is an integer expression from 1 to 255.
<m> is an integer expression from 0 to 255.
<string 2> is a string expression.
Example:
MID$(A$,2,4) = “ABCDEFGH”
Remarks:
The characters in <string 1>, beginning at position <n> are replaced by the char-
acters in <string 2>.
The optional <m> refers to the number of characters from <string 2> that will be
used in the replacement. If <m> is omitted, all of <string 2> is used. However,
regardless of whether <m> is included or not, the replacement of characters
never goes beyond the original length of <string 1>.
Refer to the discussion of the MID$ function
ON COM GOSUB Statement
Purpose:
Defines an interrupt service routine to handle data coming into a
com port buffer
Format:
ON COM(<n>) GOSUB <line>
<n> is the port number (1 or 2).
<line> is the line number of the first statement of the interrupt
service routine.
Example:
ON COM1 GOSUB 1000
Remarks:
This statement is not valid unless it is executed after the specified port has been
opened.
An interrupt service routine cannot be interrupted by another interrupt. If a new
interrupt occurs during processing of a previous interrupt, branching to handle
the new interrupt will not take place until after the RETURN statement of the first
interrupt service routine is executed. This means that, depending on the branch
timing, nothing may be in the buffer when execution branches to the interrupt
routine. It is therefore necessary to check whether data is in the buffer by execut-
ing the LOC or EOF Command at the beginning of the interrupt routine.
All subroutines must end with a RETURN statement.
If a statement specified by the branch line number is non-executable, execution
will begin with the first executable statement following the branch line number.
Commands, Statements, and Functions
Summary of Contents for C500-ASC04
Page 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Page 5: ...iv ...
Page 7: ...vi ...