Navigation:  Programmer's Reference > Sending data to DPlot from another application >

FileAppend macro command

Print this Topic Previous pageReturn to chapter overviewNext page

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, equations that evaluate to numbers, or character strings. Character string parameters are always bound by double quotation marks. Equations must be preceded by an equals sign (=).

The pipe symbol (|) in the command syntax indicates that a parameter is optional, and should not be included in your macro unless otherwise noted.

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.


 

[FileAppend("filename")]
or
[FileAppend("filename","option,option,option,...")
(file import plugins only)

JR   Viewer

Opens a file, creating one or more new curves in the currently active document. The file type must not be a DPlot file. The FileType command should be issued before the FileAppend command.

The filename parameter may include the shortcuts |DPLOTDRIVE| or |DPLOTPATH| to include the drive or full path, respectively, where DPlot is installed. This is most often useful when DPlot is installed to a removable drive. Either form must be uppercase or will be ignored. For example:

FileAppend("|DPLOTDRIVE|\datafiles\myfile.csv")

will attempt to open the file myfile.csv located in the \datafiles folder on the drive where DPlot is installed.

The trailing colon will be included with |DPLOTDRIVE|; similarly the trailing backslash will be included with |DPLOTPATH|. The drive letter and colon are included in |DPLOTPATH|; there is no need to use, for example, "|DPLOTDRIVE||DPLOTPATH|filename".

The second form of this command is only useful for file import plugins that include the function plugin_readfileex. The interpretation of the options string is entirely up to the plugin and is passed unchanged to the plugin_readfileex function. Generally this options string is used to accept options for the plugin programmatically rather than forcing user input via a dialog box. Options for file import plugins distributed with DPlot are described below.

AMO Transient Recorder Files

Options are comma-separated values.

Option, Start_Time, Stop_Time
where:

Option0=read entire record.
1=read 1st preview block.
2=read 2nd preview block.
3=read 3rd preview block.
4=read full record between Start_Time and Stop_Time (seconds). Start_Time and Stop_Time are optional and are ignored for all but Option=4.

ArcView Shapefiles

Only one option available: Separate
where:

SeparateIf non-zero, different entities within the file will be treated as separate curves. If 0, different entities will be combined into the same curve, with a marker point with latitude = 100 degrees inserted between entities. For all shapefiles, the plugin turns on Mercator Projection scaling, which in turn forces Amplitude Limits to +/-85 degrees. For Separate = 0, this will in effect split the shapefile entities into separate pieces, though they will remain part of the same data set.
If a shapefile contains more entities than the maximum number of curves (100 minus the number of existing curves), this option is ignored and all entities will be combined.

Multiple-column text files (2 or 3D)

The Pick Columns to Plot option on the Open dialog is persistent, and if checked then the Specify Columns to Plot dialog will always appear after a FileAppend (or FileOpen or ForFilesIn) command is issued. If your file has the default layout and you do not want to display the Specify Columns to Plot dialog, use a ColumnsAre command before FileAppend. For example [ColumnsAre(3)] will force FileAppend to assume X is in column 1, Y is in column 2, and Z is in column 3 without prompting the user for that information.

 

 


Please note:

Character string arguments require a bit of care, depending on your development environment. Character string arguments in all DPlot commands are always enclosed by double quotation marks. In some environments (Visual Basic and all flavors of C, for example), double quotation marks are also used to delineate all character strings (including the command itself). The following example will always cause a syntax error in Visual Basic:

ret = DPlot_Command(docnum,"[FileOpen("myfile.grf")]")

Instead, use:

ret = DPlot_Command(docnum,"[FileOpen(""myfile.grf"")]")

in C, C++, C# you'd accomplish the same thing with:

ret = DPlot_Command(docnum,"[FileOpen(\"myfile.grf\")]");

If a character string argument is a variable, as in (VB):

Dim arg as string
arg = "myfile.grf"

... then you can build the command in VB as:

ret = DPlot_Command(docnum,"[FileOpen(" & chr$(34) & arg & chr$(34) & ")]")

In all flavors of C, the same can be accomplished with

char arg[256];
char cmd[512];
strcpy(arg,"myfile.grf");
sprintf(cmd,"[FileOpen(\"%s\")]",arg);
ret = DPlot_Command(docnum,cmd);

This does not apply to the DPlot macro editor, in which each line is by definition a character string and does not require delineators, nor to FORTRAN and possibly other languages, in which the delineator for character strings is a single quote, e.g. '[FileOpen("...")]'

To embed a double quotation mark within a character string which is itself delineated by double quotation marks, use the Symbol font equivalent instead. For example, "Radius=6{\s²}" inches will be processed as

Radius=6"

 


 

 


Page url: https://www.dplot.com/help/index.htm?fileappendcommand.htm