Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 
Table of contents Previous: McBASI Interpreter Commands and Reserved Words KEYIN Next: McBASI Interpreter Commands and Reserved Words OPEN Index

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.


Table of contents Previous: McBASI Interpreter Commands and Reserved Words KEYIN Next: McBASI Interpreter Commands and Reserved Words OPEN Index
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690