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
 opposite than expected behavior of conditional ope

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
asafok Posted - 03/30/2020 : 10:21:12 AM
Origin 2020 (64-bit) SR1
Operating System: windows 10
Hello
I write this line in the F(x)= (column calculation row):
P<=10?:B-D/E
the result of the condition is exactly the opposite: only the P>10 execute B-D/E.
?
//Asaf
2   L A T E S T    R E P L I E S    (Newest First)
Chris D Posted - 03/30/2020 : 11:23:37 AM
That is the correct behavior for the ternary operator.

For the logical statement:
if A==<value> then X else Y

The ternary operator would be:
A==<value> ? X : Y

So, in
P<=10?:B-D/E

You have an else but not a then.

Maybe you mean this:
P<=10?B-D/E:

More properly, you'd provide an else in the form of something that equates to a "missing value": E.g.:
P<=10?B-D/E:0/0

where 0/0 equates to a missing value.

Thanks,
Chris Drozdowski
Originlab Technical Support
YimingChen Posted - 03/30/2020 : 11:13:32 AM
Should be
P<=10?B-D/E:


James

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