There are two methods for transferring DPlot data to other applications.
Copy data to the Clipboard.
You can copy the data values of a single curve to the Clipboard, then paste the data in the target application. See Copy Data Values command.
Use target application's DDE features.
If the target application can serve as a Dynamic Data Exchange (DDE) client, you can instruct DPlot to provide application information and/or data for one or more curves.
System Topics
The following Microsoft Excel formulas may be used to request information from DPlot:
Formula |
Returns |
=DPlot|System!Topics |
XYPlot |
|
System |
|
Plot title(s), if any |
=DPlot|System!SysItems |
Topics |
Or |
SysItems |
=DPlot!System!TopicItemList |
Formats |
|
Status |
|
TopicItemList |
|
Help |
=DPlot|System!Formats |
TEXT |
=DPlot|System!Status |
Ready or Busy |
=DPlot|System!Help |
See DPlot Help... "Transferring DPlot data to other applications" |
=DPlot|System!DecimalSymbol |
Decimal symbol character used by DPlot on input; typically a period or a comma. |
=DPlot|System!DocumentNumber |
Index of the document associated with this DDE conversation, 1-32 |
=DPlot|System!NumberOfDocuments |
Number of open document windows. |
=DPlot|System!LastNewCaption |
Returns the most recently set document caption (generally the caption for the most recently created document) |
=DPlot|System!LastNewDocNum |
Similar to LastNewCaption; returns the document index (1-32) of the most recently created document. |
=DPlot|System!Version |
DPlot version number |
=DPlot|System!LastCurveFit |
Returns the polynomial curve fit last generated by using the Polynomial Curve Fit menu command or by a CurveFit macro/DDE command. |
NOTE: For formulas that return more than one value, with values separated either by tabs (e.g. TopicItemList) or carriage returns (e.g. LastCurveFit), you must first select the desired cells in the worksheet, enter the formula, then press <Ctrl>+<Shift>+<Enter>.
The syntax in Visual Basic programs for the above commands is:
<control>.LinkTopic="DPlot|System"
<control>.LinkMode=2
<control>.LinkItem=<item to retrieve, e.g. "NumberOfDocuments">
<control>.LinkRequest
<control>.LinkMode=0
where <control> is a text box or label.
If one or more plots are currently open, you can use the target application's DDE features to request information about those plots. For example, if you open the DPlot file c:\my data\squares.grf, then the following request items can be used to request information about that plot:
Request Item |
Returns |
Curve001 |
1 1 |
DecimalSymbol |
Decimal symbol assumed by DPlot. Typically . or ,. |
FileName |
c:\my data\squares.grf |
FileTitle |
squares.grf (text appearing in the plot title bar) |
fname |
squares (filename minus the extension) |
Formats |
TEXT |
LastCurveFit |
Presents the last curve fit solution obtained via Generate>Polynomial Curve Fit. For example with squares.grf: y = C(0) + C(1)*x + C(2)*x^2 + ... Coefficients C(00) = 0 C(01) = 0 C(02) = 1
Correlation coefficient is 1
Standard error about the line = 0 |
Legend(n) |
Legend title for n=0 or legend entry for curve n (n = 1 through number of curves) |
ListPeaks |
Curve 1 Minimum = 1 at X = 1 Maximum = 16 at X = 4 Mean = 7.5 Standard deviation = 6.557439 Standard error = 0 |
MaxCurves |
maximum number of curves |
MaxPoints |
maximum number of points/curve |
NumberOfCurves |
1 |
NumberOfPoints |
4 |
Path |
c:\my data\ (folder location of the saved plot, including a trailing backslash) |
Titlen (n=1-4) |
Title lines |
TopicItemList |
Formats |
Version |
Version number of DPlot or DPlot Jr, e.g "2.3.5.3" |
XAxisLabel |
X axis label |
YAxisLabel |
Y axis label |
ZAxisLabel |
Z axis labelLas |
To retrieve this information in Excel, use a formula of the form "=application|topic!item". The "application" in all cases is "DPlot". The "topic" is the file title of a plot (the text appearing in the document title bar. To retrieve the X axis label from squares.grf, for example, use "=DPlot|squares.grf!XAxisLabel".
If interacting with DPlot via the DPLOTLIB DLL, all of the information shown above can be retrieved with a call to DPlot_Request. For example, to retrieve the character used as a decimal symbol in C:
char sDecimal[2];
int dwSize=sizeof(sDecimal);
DPlot_Request(0,"DecimalSymbol",sDecimal,&dwSize);
The plot title is the text that appears in the caption of the plot window. To retrieve the caption of the last document created, you can use the LastNewCaption request mentioned above. For example, if your application uses DPlot to produce Histograms, the first plot produced will have a caption of "Histogram". The 2nd histogram (assuming the 1st one is still open) will have a caption of "Histogram1", the 3rd a caption of "Histogram2", etc. However, there is no good way for you to determine programmatically whether an end user might have closed a document that your application produces, so it is all but impossible to predict what the caption of a new document might be. If you use LastNewCaption immediately after taking some action that produces a new document, you can be assured that the return value is the caption you are interested in. You can also retrieve the document index (a number, 1-32) of the last document created by requesting LastNewDocNum, which is more useful for programs using DPLOTLIB's DPlot_Command and other functions. To request the above information knowing the document index but not the document's caption, you can use the form Doc<n> for the DDE topic, where n is the document index (1-32).
Data values submitted by DPlot are separated by <TAB> characters. A <CR><LF> sequence separates X,Y pairs and the LastCurveFit output.
____________________________
See also
Request macro function
Page url:
https://www.dplot.com/help/index.htm?helpid_exportdata.htm