WzPreview Procedure
Starts a VDA Tool used to view an ASCII file’s contents and select which parts of the file are to be read in as PV‑WAVE variables.
Usage
WzPreview[, filename]
Parameters
filename — (optional) A string containing the name of the ASCII file to preview. If not specified, WzPreview will start without displaying a file.
Keywords
AutoDefine — If set along with filename, then import definitions will be automatically defined when the file is previewed. If no file is specified, this keyword has no effect.
Columns — An integer specifying the number of visible columns in the WzPreview window.
Fixed — Set this keyword if the file contains fixed-width values that are column-oriented.
Free — Set this keyword if the file contains non-fixed width values (either column-oriented) that are separated by delimiters.
NoBlock — If specified, the event loop (WwLoop) that is started by the VDA Tool will use the given value. By default a value of 1 (non-blocking loop) will be used. However, it may be necessary in certain circumstances to force a non-blocking loop by specifying NoBlock = 2. (See WwLoop in the PV‑WAVE Application Developer’s Guide for more information.)
Parent — The widget ID of the parent widget.
Position — Specifies, in pixels, the x and y (horizontal and vertical) coordinates for the starting location of the upper-left corner of the VDA Tool window.
Restore — A data structure previously saved in the Tools Manager with the TmSaveTools function. This keyword is reserved for internal use; it is not to be used at the command line (see Discussion).
Rows — An integer specifying the number of visible rows in the WzPreview window.
Template — A string containing the name of a VDA Tool template file.
Discussion
The Restore keyword is used specifically by the TM_RESTORE method. For information on the TM_RESTORE method, refer to the source code for WzPreview in:
<wavedir>/lib/vdatools/wzpreview.pro
<wavedir>\lib\vdatools\wzpreview.pro
Where <wavedir> is the main PV‑WAVE directory.
The Autodefine feature of the WzPreview tool assumes the last line in the header contains the variable names. There should be a 1-to-1 correlation between the variable names listed in the header and the number of data columns. Refer to the <tswave_dir>/data/air_qual.dat for an example data file that conforms to the correct standards.
The variable names must meet specific criteria to be considered valid PV‑WAVE variable names. PV‑WAVE variables are named by identifiers that have the following characteristics:
Each identifier must begin with a letter and may contain from 1 to 31 characters.
The second and following characters may be a letter, digit, the underscore character, or the dollar sign.
A variable name may not contain embedded spaces, because spaces are considered to be delimiters.
Characters after the first 31 are ignored.
Names are case insensitive, lowercase letters are converted to uppercase; so the variable name abc is equivalent to the name ABC.
A variable may not have the same name as a function or reserved word. This will result in a syntax error. Avoid the following reserved words:
AND |
BEGIN |
CASE |
COMMON |
DO |
ELSE |
END |
ENDCASE |
ENDELSE |
ENDFOR |
ENDIF |
ENDREP |
ENDWHILE |
EQ |
FOR |
FUNCTION |
GE |
GOTO |
GT |
IF |
LE |
LT |
MOD |
NE |
NOT |
OF |
ON_IOERROR |
OR |
PRO |
REPEAT |
THEN |
UNTIL |
WHILE |
XOR |
|
|
Example
WzPreview, !Data_Dir + 'air_qual.dat', /Fixed