INQUIRE
Name:
Type:
Purpose:
Determine if a file exists.
Description:
Dataplot commamnds that access pre-existing files (e.g.,
READ, CALL,
LIST) have several specific
restrictions.
- A "." is required in the name to identify the string as a
file.
This restriction does not apply to the INQUIRE command.
- File names that contain spaces or hyphens should be enclosed
in quotes (").
For the INQUIRE command, the quotes are optional.
- Dataplot will first check for the file in the current directory
as given. For operating systems where file names are case
sensitive (Linux/Unix, Mac OS X), Dataplot will then check the
name with all characters converted to lower case and with all
characters converted to upper case. If the file is not found in
the current directory, Dataplot will then check in the Dataplot
auxillary directory (e.g., "/usr/local/lib/dataplot" under Linux
or "C:\Program Files (x86)\NIST\DATAPLOT under Windows) for the
file.
The INQUIRE command does not do this. It checks the file name
as given in the current directory only.
Syntax 1:
LET <iflag> = INQUIRE <file>
where <file> is the name of the desired file;
and <iflag> is a parameter that contains the file status.
If the file exists, the <iflag> parameter will be set to 1. If
the file does not exist, the <iflag> parameter will be set to
0.
Syntax 2:
LET <iflag> = INQUIRE <unit>
where <unit> is an integer value between 1 and 99;
and <iflag> is a parameter that contains the file status.
If the unit number is associated with a currently open file, the
<iflag> parameter will be set to 1. If the unit number is not
associated with a currently open file, the <iflag> parameter
will be set to 0.
This syntax is typically used by the Dataplot developers for
debugging purposes.
Examples:
LET IFLAG = INQUIRE BERGER1.DAT
LET IFLAG = INQUIRE "MY FILES\SAMPLE.DAT"
LET IFLAG = INQUIRE 44
Note:
The specified file name should be given as a literal string. If the
file name is stored in a string, you can use the "^" character as in
LET IFLAG = INQUIRE ^FNAME
Note:
File names are currently limited to 80 characters.
Default:
Synonyms:
Related Commands:
CLOSE
|
=
|
Close a file based on the associated unit number.
|
READ
|
=
|
Read data from file or terminal.
|
SERIAL READ
|
=
|
Read data serially from file or terminal.
|
CALL
|
=
|
Execute the commands stored in a file.
|
LIST
|
=
|
List the contents of a file.
|
Applications:
Implementation Date:
2016/02
2016/06: Added support for unit numbers (Syntax 2)
Program 1:
LET IFLAG = INQUIRE BERGER1.DAT
IF IFLAG = 1
READ BERGER1.DAT Y X BATCH
ELSE
PRINT "FILE BERGER1.DAT NOT FOUND"
END OF IF
Program 2:
PROBE IPL1NU
LET UNIT = PROBEVAL
LET IFLAG = INQUIRE ^IPL1NU
Privacy
Policy/Security Notice
Disclaimer |
FOIA
NIST is an agency of the U.S.
Commerce Department.
Date created: 02/29/2016
Last updated: 06/10/2016
Please email comments on this WWW page to
alan.heckert@nist.gov.
|
|