/
"iif" Functions

"iif" Functions

List of Logical Statements

The following are logical statements that can be used within the expressions of iif parameters:

.EQ. → Equal to (==)

.NE. → Not equal to (!=)

.LT. → Less than (<)

.LE. → Less than or equal to (<=)

.GT. → Greater than (>)

.GE. → Greater than or equal to (>=)

.AND. → AND (&&)

.OR. → OR (||)

.NOT. → NOT (!)

 

Example:

<O N="iifobject1" T="Project" Category="Logical Statement and Test" TransAlignRule="Right"> <!-- created by ParamML Examples on 09.02.2023 --> <P N="a" V="3" /> <P N="b" V="-40" /> <P N="c" V="-25" /> <P N="d" V="-30" /> <P N="e" V="80" /> <O N="iffexample" T="DesignCode"> <P N="Test1" V="iif(a .GE. b,c,d)" /> <P N="Test2" V="iif(a .EQ. 1,b, a .EQ. 2,c,a .EQ. 3,d,a .EQ. 4,e)" /> </O> </O>
iffexample

In the example provided, if the value of "a" is greater than "b", then the result of "Test1" will be "c". If not, the result will be "d".

In "Test2", a nested "iif" function is utilized to handle more complex tests.
If the value of "a" is equal to 1, the result will be "b".
If "a" is equal to 2, the result will be "c".
If "a" is equal to 3, the result will be "d".
And, if "a" is equal to 4, the result will be "e".

To view this example in the library, see (OpenBrIM Platform)

 

Example:

<O N="Calculation1" T="Group"> <!-- .GE. → Greater than or equal to (>=) --> <P N="Len" V="3000" D="Length of ground" Role="Input" Category="Calculation1" /> <P N="dynamic_effect" V="1+15/(Len/1000+37)" D="Dynamic effect Index" /> <P N="Usedynamic_effect" V="iif(dynamic_effect .GE. 1.3, 1.3, dynamic_effect)" /> </O>

The dynamic effect coefficient is determined using a formula. If the calculated value is greater than or equal to 1.3, it is set to 1.3. If it is less, the calculated value is used. This is presented as follows:

Debug Trace → Calculation1
<O N="Calculation2" T="Group"> <!-- .AND. → AND (&&) example --> <P N="A" V="22" /> <P N="B" V="20" /> <P N="C" V="12" /> <P N="C1" V="iif(A .LT. B .AND. B .GT.C,C,9)" /> </O>

.AND. In this expression, both the conditions on the left and right must be satisfied in order for the positive value to be accepted.

The value at which C1 will occur will be 9, as the condition A<B is not provided, but B>C is provided. However, if both conditions are not met simultaneously, C1 will be assigned a negative value. In this case, C1=9.

.OR. A positive value is accepted if one of the two conditions is met in the statement.

The value at which C1 will occur will be 12 because A<B equality is not provided, B>C is provided. If only one of these two conditions is true, the result leads to a positive value. C1 takes the positive value and becomes C1=C. So C=12.

.EQ. The NULL expression searches for the absence of an object.

C1=E. So C1=50 .

To view this example in the library, see (OpenBrIM Platform)

Related content

Communication Between Objects Example
Communication Between Objects Example
Read with this
Logical Statements
Logical Statements
More like this
Parameters
Parameters
Read with this
Guard Parameter
Guard Parameter
More like this
EGITIM 3 28/05/22
EGITIM 3 28/05/22
More like this
iif Fonksiyonu
iif Fonksiyonu
More like this