McIDAS User's Guide
Version 2017.1

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


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.


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