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
 Set column values: help needed.

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
asdfghjkllkjhgfdsa Posted - 06/30/2012 : 10:15:29 AM
Hi,
I am very new in originC. can anyone help me in the following?
I want to do set column values using a script in originC.

I am able to do things like col(A)+col(B). or col(A)+constant.

but I am not able to do,

col(A)-value; where "value" is a variable in my program.

This might be very trivial.
Can any one please help?

thanks.

I Post a part of the program here:

Column col;
col.Attach(wksTarget, 3);
col.SetFormula("col(B)-col(C)", AU_AUTO);
col.ExecuteFormula();


Worksheet wks2("[Book1]nlfitpeaks1");
double value;
Worksheet wks_report = wks2;
if( wks_report )
{
uint uid;
Tree tr;
if( wks_report.GetReportTree(tr, &uid, 0, GRT_TYPE_RESULTS, true) )
{
string strOut;
tree_to_str(tr, strOut); // translate from result tree to string, print this string you will see it as a table format
out_str(strOut);

out_tree(tr);

if(tr.Parameters.xc.Value.IsValid()&&tr.Parameters.xc.error.IsValid())
{
value = tr.Parameters.xc.Value.dVal;
double valueErr = tr.Parameters.xc.error.dVal;
// printf("\t value1 = %f, Error1 = %f\n",value,valueErr);
}
else
{
double value = 1000000000;
printf("\t DO value is not correct = %f\n",value);
}

}
}


// I want to use The variable "value" in the formula like: col(A)- value;
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 07/01/2012 : 10:27:51 PM
Hi,

Please try something like:

Column col;
col.Attach(wksTarget, 2);
double value = 2.0;  // assume value = 2.0
string strFormula = "col(A) - " + value;  // construct a formula string
col.SetFormula(strFormula, AU_AUTO);
col.ExecuteFormula(); 


Penn

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