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 IF Next: McBASI Interpreter Commands and Reserved Words KEYIN Index

INPUT

Allows data to be gathered from an LW file and the RUN command line.


LW File Data Gathering


Syntax

INPUT @u(r) , A$


Parameters

u

numeric expression for the unit number; @ is required

(r)

numeric expression used to specify a record number; record numbers begin with zero

A$

variable into which the record is read


Remarks

The input statement for LW files is restricted; only one character variable may be designated in the list and the record from the file will be read into this variable. This form of INPUT is useful for reading text files. Refer to the OPEN statement regarding fixed length and variable length records. The INPUT statement in this form handles both; the (r) record number is available for either format.


Example

INPUT @3, A$

IF MID$(A$,1,4)=EOF$ GOTO xxx

This example tests for an end-of-file, using the pseudovariable EOF$.

Run Command Line Data


Syntax

INPUT a,b,c


Parameters

a,b,c

variables


Remarks

Values are taken from the RUN command line as positional parameters of a normal McIDAS command. If the named variable is numeric, it is picked up as a number. If the variable is a character string, the value is picked up as a character parameter (up to 12 characters, no blanks). Each INPUT statement of this form picks up the next positional parameter. Thus, these statements are equivalent to the single INPUT statement above:

INPUT a

INPUT b

INPUT c

If the RUN command line contains a quoted string (for example, "THIS IS A QUOTED STRING), it may be read by using a character variable. The first character in the variable is a double quote (") to indicate it was picked up from the quoted string. An attempt to input a parameter which is not present results in either a numeric value of zero or a character string of length zero.


Table of contents Previous: McBASI Interpreter Commands and Reserved Words IF Next: McBASI Interpreter Commands and Reserved Words KEYIN 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