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
 Return BasicStats structure?

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
Mike Buess Posted - 04/10/2003 : 2:20:10 PM
Dataset dd;
--set up dd--
BasicStats bsStats;
Data_sum(&dd, &bsStats);

Currently I pass individual bsStats values back to LabTalk like this...

LT_set_var("v1", bsStats.N);
LT_set_var("v2", bsStats.total);
--etc.--

That works fine, but I'd rather return the entire bsStats structure and access its values in LabTalk like this...

v1 = something.N;
v2 = something.total;

Is that possible?

Mike Buess
Origin WebRing Member
3   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 04/12/2003 : 9:16:05 PM
Hi Mike,

Currently there is no support for passing a structure between OC and LabTalk. So you will need to set LT variable values like you are doing now.

However, specifically for basic stats, you could have a function such as below to execute the sum command in LT so that the stats are readily available in LT once this function is called.


void OC_sum(Dataset& dd)
{
string strCMD = "sum(" + dd.GetName() + ");";
LT_execute(strCMD);
}



Easwar
OriginLab.



Edited by - easwar on 04/12/2003 9:40:48 PM

Edited by - easwar on 04/12/2003 9:41:46 PM
Mike Buess Posted - 04/12/2003 : 12:57:10 PM
Hi Ricardo,

I don't think Dataset::Update will do it. Data_sum(&dd,&bsStats) gets the basic statistics for Dataset dd and returns them in the bsStats structure...

bsStats.N // number of values
bsStats.total // sum
bsStats.mean // mean
-etc.-

I just want to access those statistics from LabTalk as is done with the LabTalk sum(dataset) command. So my basic question is this... can an Origin C command return a structure to LabTalk. If so, how is it done? The following function compiles OK...

BasicStats OC_sum()
{
Dataset dd;
--set up dd--
BasicStats bsStats;
Data_sum(&dd, &bsStats);
return &bsStats;
}

...but I don't know how (or if) it can be used in LabTalk.

Mike Buess
Origin WebRing Member
srmcarneir Posted - 04/11/2003 : 1:44:59 PM
Hi Mike,

Would it be enough for you if you tried the Dataset::Update method? In the help files we can find a description showing that it "Update the Dataset object to or from the origin worksheet column", once your OriginC dataset is associated to an Origin worksheet. Regards.

Ricardo Carneiro

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