
7-6
Section
Details of BASIC Commands
168
let
Syntax:
[
LET
] <variable> = <expression>
Description:
Statement. Assigns a value of the <expression> on the right hand side of the statement to the
variable on the left-hand side of the expression.
Remarks:
The keyword
LET
is optional in the assignment statement. It is sufficient to use the “=” character
for assignment.
Assigning character expressions to numeric variables and vice-versa result in a “TYPE
MISMATCH” error (code B013).
If the numerical expression on the right hand side of the assignment is a different type to the
variable on the left hand side then the expression on the right hand side is converted to the type
of the variable on the left hand side before assignment.
Examples:
> 10 LET A = 12.34
> 20 PRINT A
> RUN
12.34
>
See also:
line input
Syntax:
LINE INPUT
[;][# <port expression>,][<“prompt”> (;|,)]<character variable>
Description:
Statement. Inputs an entire line of characters from the keyboard, or some other input device,
without delimiters.
<port expression> is an expression returning an integer in the range: [1… 3].
If the <port expression> is omitted the default terminal port is assumed.
<prompt> is an optional text string that is output to the terminal to prompt for the input. If the port
specified is not configured as a “TERM” or a “COMU” port then the prompt will be suppressed.
Unlike the
INPUT
statement the ‘?’ is only possible by including it in the prompt.
All input will be assigned to the character variable until a carriage return is entered. The
maximum length of the character string is 255 characters. while waiting for input the BASIC LED
will be blinking.
Commas and colons are treated as part of the input string.
Remarks:
Note:
If a semi-colon is added after the LINE INPUT, the cursor will remain on the same row
after input.
Examples
> 10 OPEN #1, “TERM:”
> 20 LINE INPUT #1, “ENTER YOUR FULL NAME : ”; A$
> 30 PRINT “HELLO ”;A$
> 40 END
> RUN
ENTER YOUR FULL NAME : JOE BLOGGS<CR>
HELLO JOE BLOGGS
>
See also:
INPUT
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...