The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Data() function fail?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
dharmarasu2 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
3   L A T E S T    R E P L I E S    (Newest First)
cjbf 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.
dharmarasu2 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




cpyang 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



The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000