Author |
Topic  |
|
dharmarasu2
Japan
3 Posts |
Posted - 03/11/2004 : 04:14:03 AM
|
Hello,
why does the Data(xmin, xmax, inc) function fail in my following orign C code?? Dataset newX, newY; newX.Data(xmin, xmax, inc);
I want the newX dataset to be filled with the minimum(xmin) to maximum(xmax) values with the increments defined by "inc" .
Or is it necessary to use the LabTalk script instead of the orgin C Data function here?
Cheers, Dharmarasu |
|
cpyang
USA
1406 Posts |
Posted - 03/11/2004 : 05:14:06 AM
|
Dataset must be attached to a real column in Origin, so you should use vector instead,
vector newx;
newx.Data(xmin, xmax, inc);
To use Dataset, then you need to, for example
Worksheet wks = Project.ActiveLayer(); if(wks.GetNumCols() < 2) wks.SetSize(30,2);
Dataset newX(wks,0); // col(A) Dataset newY(wks,1); // col(B)
newX.Data(xmin, xmax, inc);
CP
|
 |
|
dharmarasu2
Japan
3 Posts |
Posted - 03/11/2004 : 5:07:06 PM
|
Thankyou. That did the Job!!
dharmarasu
quote:
Dataset must be attached to a real column in Origin, so you should use vector instead,
vector newx;
newx.Data(xmin, xmax, inc);
To use Dataset, then you need to, for example
Worksheet wks = Project.ActiveLayer(); if(wks.GetNumCols() < 2) wks.SetSize(30,2);
Dataset newX(wks,0); // col(A) Dataset newY(wks,1); // col(B)
newX.Data(xmin, xmax, inc);
CP
|
 |
|
cjbf
UK
8 Posts |
Posted - 11/13/2008 : 10:54:45 AM
|
I've found what may be a bug in Origin 8 SR4, which seemed not to be a problem some time in the past: The compiler gives the error "Error, calling function Dataset::Data has too many matches in declaration" if the vector or dataset is not integer type, when the increment is omitted (and hence defaults to the integer value 1). Specifying the increment as 1. fixes the error.
vector<double> newx; newx.Data(0., 10,1.); //works newx.Data(0., 10); // gives compile error
Hope that helps, Chris. |
 |
|
|
Topic  |
|
|
|