if statement

Discuss issues and ideas you have to configuring displays with PowerVision
asadilan
Posts: 8
Joined: Fri Aug 02, 2013 12:38 pm

if statement

Post by asadilan » Tue Aug 13, 2013 5:13 pm

Hi All,

Was wondering if this is possible?

if(A = 0, B = 1, (B = 2 C = 2))

What i am trying to do is if A = 0 then B = 1 else b = 2 and C=2.

Thanks
Asadilan
ksaenz
Enovation Controls Development
Enovation Controls Development
Posts: 263
Joined: Thu Aug 19, 2010 7:53 am

Re: if statement

Post by ksaenz » Wed Aug 14, 2013 2:28 pm

Hello Asadilan,

In calculation events the if() function is available and it works in a similar way as it does in Excel.
Remember that calculation events only return a value to the parent variable so you will need two of them
For variable B:.

Code: Select all

if( A = 0, 1, 2 )
For variable C:

Code: Select all

if( A = 0, C, 2 )
In scripting the if statement works as in C:

Code: Select all

if( A == 0 )
{
   B = 1;
}
else
{
   B = 2;
   C = 2;
}
Regards,
ksaenz