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
 Origin Forum
 IF/ELSE in "Set Column Values"

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
rnnelson Posted - 10/14/2004 : 10:03:24 AM
Origin Version (Select Help-->About Origin): 7.5 Pro SR4
Operating System: Windows 2000 Pro
I have an application in which I need to set column values to 1 of 4 different equations based on the value of the variable in the x-column. Doing this with nested IF type statements is extremely awkward. Is there an "IF/ELSE" type function available in the set column values. I know there is an IF/ELSE structure in labtalk but I would rather not have to write and execute a separate Labtalk function.
Bob

3   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 10/20/2004 : 10:02:32 AM
Hi Bob,

Cool! I didn't know that was possible. I think that deserves a spot in OriginLab's Knowledge Base. Perhaps even in the manual. Could be very useful for those who rely on Set Column Values.

Mike Buess
Origin WebRing Member
rnnelson Posted - 10/20/2004 : 09:51:50 AM
Mike,
I figured out a way to do this as follows:
For each segment create the appropriate test and follow it with the statement to be executed.
Then (on a separate line for clarity) add a colon.
Repeat this for all but the last step which simply has the equivalent of the "else" following the last colon. See the example below. Because the tests are in order, there is no need to use multiple tests at each step. The procedure executes until a logical test is satisfied or until the final step is reached.
Bob

col(T)> 90.3 ? 8.06158 - 917.20884/col(T)+ 0.0305
:
col(T)> 89.3? 9.4576 - 1044.0/col(T) + 0.0305
:
col(T)> 87.3? 6.962 - 820.84/col(T)+ 0.0305
:
166.64523 - 3398.39776/col(T) - 67.07301*log(col(T))+ 0.0305

Mike Buess Posted - 10/14/2004 : 11:21:35 AM
Hi Bob,

Depending on your equations you might be able to use ternary operators in place of IF/ELSE statements. See the following forum topic for an example...

http://www.originlab.com/forum/topic.asp?TOPIC_ID=3285

Mike Buess
Origin WebRing Member

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