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
 why is it?

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
liujibao Posted - 02/22/2004 : 09:49:16 AM
void test()
{
string str,str1;
str1="data1";
//LT_execute("win -a data1");
Worksheet wks(str1);
Dataset tempcol(wks,0);
tempcol.GetName(str);
LT_execute("stat.ds.data$=str");//LT_execute("stat.ds.data$=tempcol");
LT_execute("stat.ds()");
double dbl1,dbl2;
dbl1=LabTalk.stat.ds.quartl25;
dbl2=LabTalk.stat.ds.quartl75;
int num=LabTalk.stat.ds.size;
}


why is it right sometimes,but is worong sometimes?

How to use stat.ds?
why is it both zero about dbl1 and dbl2?


Edited by - liujibao on 02/22/2004 10:22:43 AM
3   L A T E S T    R E P L I E S    (Newest First)
Iris_Bai Posted - 02/24/2004 : 01:16:31 AM
HI,
I cannot reproduce this problem. The following are my testing codes, could you try again?

void test()
{
Worksheet wks("Data1");
Column tempcol = wks.Columns(0);
string str, strPage;
wks.GetPage().GetName(strPage);
tempcol.GetName(str);

str = strPage + "_" + str;
str.Format("stat.ds.data$=%s",str);
LT_execute(str);
out_str(str);//Now, str is "stat.ds.data$=DATA1_A"
}


Iris
liujibao Posted - 02/23/2004 : 07:39:44 AM
This is a bug maybe !
When I debug the codes and the breakpoint is at the line:
LT_execute("stat.ds.data$=str");//LT_execute("stat.ds.data$=tempcol");

I find the value of thevariable "str" is "Data1_A",but the value of dbl1 and dbl2 are both zero.
When I modify my codes as cpyang said:
tempcol.GetName(str);
str.Format("stat.ds.data$=%s",str);

then,the value of "str" is yet "Data1_A", but the result are right.
cpyang Posted - 02/22/2004 : 10:50:14 AM
Maybe you should use pure C code.

To use LabTalk in OC code, you need to know LabTalk well.
your line

LT_execute("stat.ds.data$=str");

tells LabTalk that you are doing work with a Dataset called "Str", and I suppose there is no such dataset in your Origin session. More likely, you need to write code like

string strDataset;
strDataset = str1 + "_" + str; // assume that str = Col name

string strLT = "stat.ds.data$=" + strDataset;

LT_execute(strLT);


It looks like you need to do percentile calculation, maybe you can try the Data_percentiles function, which you can find by looking up OC Language Reference and Global Functions inside statistics.


CP





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