NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Whats wrong with my expession?

Solved!
Go to solution

Hi,

 

whats wrong with this expression?

 

(( Locals.ChannelA.Info.Input.ID.Name != "" ) && ( Locals.ChannelA.Info.Output.ID.Name != "" )) ? ( Locals.ChannelA.Limits = Locals.Limits.LimitsList[ Val( Locals.Test.Current.ChannelA.LimitName ) ] )

 

The error messages says Unexpected token: "?". Basically I'd just like to implement an IF structure. The expression is in expression tab of a statement type step.

 

Must be something mega obvious...

 

Thanks,

1984

0 Kudos
Message 1 of 5
(2,590 Views)
Solution
Accepted by topic author 1984

ANSI C defines a boolean if clause as <Boolean Criteria>?<TRUE>:<FALSE>.

Looking at your expression, there is the complete <FALSE> branch missing.

 

EDIT: I stated the part with ANSI C because TS is implementing the same syntax

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(2,585 Views)

I see... is there a "do nothing" command in TestStand? Or should I just put simply a False constant to the false branch?

0 Kudos
Message 3 of 5
(2,581 Views)

False should work fine, but my favorite is to use the keyword Nothing

0 Kudos
Message 4 of 5
(2,559 Views)

Thanks! All clear now.

0 Kudos
Message 5 of 5
(2,554 Views)