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
 LabTalk Forum
 processing string for formula output

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
maric001 Posted - 11/25/2014 : 11:34:23 AM
Origin Ver. and Service Release (Select Help-->About Origin): 9.1
Operating System: win7 64

Hi there,
i am building up a formula from my origin project:

win -o Formeln {
page.active=2;
loop(ss,1,wks.maxRows){
string Ref$=Col(2)[$(ss)]$;
string Sig$=Col(3)[$(ss)]$;
string RefIK$=Col(4)[$(ss)]$;
string SigIK$=Col(5)[$(ss)]$;
string RefITK$=Col(6)[$(ss)]$;
string SigITK$=Col(7)[$(ss)]$;
string RefMTK$=Col(8)[$(ss)]$;
string SigMTK$=Col(9)[$(ss)]$;
[Formeln]1!Col(2)[$(ss)]$="(((("+Sig$+"-"+SigIK$+")/("+Ref$+"-"+RefIK$+")"+"-"+SigITK$+")/(T1-"+RefITK$+")*1000000-"+SigMTK$+")/(T3-"+RefMTK$+")*1000";
}};

The script works so far, but since my data can contain negative values, i am ending up with something like this:

((((W66--10085,62259)/(W60--1545,35772)-2,37845)/(T1--55430,60782)*1000000--1,40652)/(T3-31328,2108)*1000

How to replace the double minus "--" with a single plus?

Cheers

Markus
1   L A T E S T    R E P L I E S    (Newest First)
lkb0221 Posted - 11/26/2014 : 09:30:52 AM
Hi, Markus

Modify the loop as following:

// Start
// ...
string SigMTK$=Col(9)[$(ss)]$;
string Result$ = "(((("+Sig$+"-"+SigIK$+")/("+Ref$+"-"+RefIK$+")"+"-"+SigITK$+")/(T1-"+RefITK$+")*1000000-"+SigMTK$+")/(T3-"+RefMTK$+")*1000";
int nRet = Result.Replace("--", "-");
[Formeln]1!Col(2)[$(ss)]$ = Result$;
// ...
// End


The str.Replace will replace all "--" by "-".

Zheng
OriginLab

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