McIDAS User's Guide
Version 2019.1

[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]


LET

Creates a replacement statement in a McBASI program.


Syntax

LET var=expr


Parameters

var

variable for numeric quantities; it is a single letter or a single letter followed by a digit; numeric variables are REAL*4 quantities; for character strings, A$ through Z$ are available and may contain up to 255 characters each

expr

any valid numeric or character expression; numeric expressions may contain the operators +,-,*, /,**, with normal precedence rules; for character or string expressions, expr may be a string variable, a string constant enclosed in quotes ("ABC"), a concatenation of two strings with the + operator, or a string function, e.g., pseudovariable TIME$


Remarks

The hexadecimal constant $nnnn is available, e.g., $FE equals 254. A single array is also available; one thousand words are reserved and referenced by following a numeric variable name with a parenthetical expression. The value of this expression is added to the value of the variable to obtain an index into this array space.


Example

LET A=0
LET B=A(13) References the 13th word
LET C=10
LET B=C(13) References the 23rd word (10 + 13)

Do not mix numeric and character expressions. The VAL function converts character to numeric; STR$ converts numeric to character. In most cases, the LET may be omitted.


[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]