Macro commands may be used either in macros or by sending the commands to DPlot via dynamic data exchange (DDE). Some commands are valid only in macros (noted by Macros Only). Commands sent to DPlot via DDE must be enclosed by square brackets [ ]. Macro commands should not include the brackets.
Command parameters shown in the descriptions below are placeholders for the actual values. Command parameters are either numeric values or character strings; character string parameters are always bound by double quotation marks.
All indices into arrays are 1-based, e.g. Curve1=1 refers to the first curve in a plot.
A 0x prefix for numbers in the descriptions below indicates hexadecimal notation; e.g. 0x0010 = 16.
JR/Viewer indicates that the command is supported by DPlot Jr or DPlot Viewer.
JR/Viewer indicates that the command is NOT supported by DPlot Jr or DPlot Viewer.
ForFilesIn("filespec") Macros Only |
|
Allows you to loop through one or more operations on several files matching a given file specification. "ForFilesIn" commands must have a matching "NextFile" command, which terminates the loop. If the "A" parameter is included, then files are appended to the active document rather than opened in a new window (DPlot files may not be appended to each other; all other file formats may). "ForFilesIn...NextFIle" loops may not be nested. The following example opens each of the files in the current directory matching the file specification ex*.grf, prints the file, and closes it before operating on the next file matching that specification.
ForFilesIn("ex*.grf")
FilePrint()
FileClose()
NextFile
This sequence:
Directory("c:\mydata")
FileType(2)
ForFilesIn("*.dat",A)
NextFile
opens all files matching the specification "c:\mydata\*.dat", assumes they are type 2 (ASCII, 1 curve per file) and appends them in the same document window.
Alternatively, the ForFilesIn command can read a list of filenames from a text file by placing an "@" symbol before the file specification. For example,
ForFilesIn("@file.lst")
FilePrint()
FileClose()
NextFile
reads a list of filenames from the file FILE.LST, prints and closes each file.
Page url: http://www.dplot.com/help/index.htm?forfilesincommand.htm