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:
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.
Examples:
LET IFLAG = INQUIRE BERGER1.DAT
LET IFLAG = INQUIRE "MY FILES\SAMPLE.DAT"
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:
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:
Program:
LET IFLAG = INQUIRE BERGER1.DAT
IF IFLAG = 1
READ BERGER1.DAT Y X BATCH
ELSE
PRINT "FILE BERGER1.DAT NOT FOUND"
END OF IF
Privacy
Policy/Security Notice
Disclaimer |
FOIA
NIST is an agency of the U.S.
Commerce Department.
Date created: 02/29/2016
Last updated: 02/29/2016
Please email comments on this WWW page to
alan.heckert.gov.
|
|