From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Status Expression

Hi,

Is there anyway of acheiving an if, elseif command to return several types
of status of a test depending on certain criteria?
The only function I have found is the conditional ?: style which can only
return one of two values.

Regards,
Iain
0 Kudos
Message 1 of 2
(4,153 Views)
"Iain Simpson" schrieb im Newsbeitrag
news:399cfe0d@newsgroups.ni.com...
>
> Hi,
>
> Is there anyway of acheiving an if, elseif command to return several types
> of status of a test depending on certain criteria?
> The only function I have found is the conditional ?: style which can only
> return one of two values.
>
> Regards,
> Iain

Hello Iain,

you can use ?: as followed to achieve elseif :

bool1 ? expr1 : (bool2 ? expr2 : expr3 )

is the same as :

if (bool1)
expr1;
elseif (bool2)
expr2;
else
expr3;

Greetings
Manfred
0 Kudos
Message 2 of 2
(4,153 Views)