Append data from a vector or Dataset object to this Origin C Dataset object and update the Origin data set from this Origin C Dataset object.
BOOL Append(vector& v, int iMode = REDRAW_NONE)
Returns TRUE on successful exit and FALSE on failure.
EX1
// Assume a worksheet and with A(X) and B(Y) void Dataset_Append_ex1() { int npts = 20; static int nn = 1; Worksheet wks=Project.ActiveLayer(); if (wks) { Dataset aa(wks,0); Dataset bb(wks,1); vector a(npts); vector b(npts); for(int ii = 0; ii < npts; ii++) { a[ii] = nn++; b[ii] = rnd(); } aa.Append(a, REDRAW_REFRESH); bb.Append(b, REDRAW_REFRESH); } return; }
EX2
// Prepare a worksheet, fill A(X) and B(Y) with 0.5 // High light B(Y) to plot a scatter graph, //(1)set plot active and then execute LabTalk script command "set %C -an 1" //(2)then active worksheet to execute the code void Dataset_Append_ex2() { int times = 50; Worksheet wks=Project.ActiveLayer(); if (wks) { Dataset aa(wks,0); Dataset bb(wks,1); for(int ntime = 0; ntime < times; ++ntime) { int npts = 20; vector a(npts); vector b(npts); for(int ii = 0; ii < npts; ii++) { a[ii] = rnd(); b[ii] = rnd(); } aa.Append(a, REDRAW_REALTIME_SCOPE); bb.Append(b, REDRAW_REALTIME_SCOPE); } } return; }
vectorbase::Append, Dataset::Update
origin.h