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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 opposite than expected behavior of conditional ope
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

asafok

Sweden
5 Posts

Posted - 03/30/2020 :  10:21:12 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

YimingChen

1669 Posts

Posted - 03/30/2020 :  11:13:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Should be
P<=10?B-D/E:


James

Edited by - YimingChen on 03/30/2020 11:13:52 AM
Go to Top of Page

Chris D

428 Posts

Posted - 03/30/2020 :  11:23:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000