McIDAS User's Guide
Version 2019.1

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


PRINT

Displays command text on your workstation.


Syntax

PRINT list


Parameter

list

is zero or more expressions; place a comma or semicolon between expressions; commas tabulate to a print position (column) that is a multiple of 16; semicolons allow no spaces to be inserted; do not end the list with a semicolon or comma unless you don't want the statement to execute until a future PRINT or KEYIN statement is executed


Remark

When developing programs that generate commands, use the PRINT statement for testing. It lets you to see the command text on your workstation. The PRINT statement is identical in structure to the KEYIN statement.


Examples

LET X=123
LET A$= "KMSN"
LET T= 12.0
PRINT "this is a test ";X;
KEYIN "SFCLIST ";
PRINT " of the ",
KEYIN A$;
PRINT " print statement"
KEYIN " ";T

This example produces the following print line and submits the command:
SFCLIST KMSN 12.

this is a test 123 of the print statement

? "A=";A
PRINT "A=";A

The question mark (?) may be used in place of the PRINT statement. For example, the two statements above are equivalent:

Printing to a Text File

Output may be directed to a text file in either fixed length or variable length (text) format. This file-directed form of the PRINT statement has the following syntax.


Syntax

PRINT @u(r),list


Parameters

u

numeric expression for the unit number; @ is required

r

numeric expression used to specify the record number (begins with zero); parentheses are required; may only be specified for files with fixed length records (see the OPEN statement); variable length files are sequentially written; if the r clause is omitted, the next record is assumed (record following the last one written); the comma is required and followed by a list of variables, constants, etc.; if a PRINT statement ends with a semicolon or comma (meaning do not print this yet), the @u(r) clause is ignored

list

is zero or more expressions; place a comma or semicolon between expressions; commas tabulate to a print position (column) that is a multiple of 16; semicolons allow no spaces to be inserted; do not end the list with a semicolon or comma unless you don't want the statement to execute until a future PRINT or KEYIN statement is executed


Example

PRINT @4,EOF$

This is a final PRINT statement that outputs a logical end-of-file. Use it for a sequential file that will be read by another McIDAS program.


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