Contents - Index


IF/IF$

 

IF(A, B, X, Y, Z) allows conditional assignment statements in the Main part of an EES program.  

 

If A<B, the function will return a value equal to the value supplied for X;  if A=B, the function will return the value of Y;   if A>B, the function will return the value of Z.  

 

In some problems, use of the IF function may cause numerical oscillation.  An alternative way to provide conditional assignment statements is with the IF - THEN - ELSE or REPEAT UNTIL statements in a Function or Procedure.  Note the the IF - THEN - ELSE statements  cannot be used in the Main program, but the IF function can be used.  

 

IF$(A, B, X$, Y$, Z$) operates exactly like the IF function but it returns a string variable instead of a numerical value.  The last three arguments for this function should be string variables or string constants.

 

(Note:  use a semicolon instead of a comma as the list separator when using the European numerical format).

 

Note:  The IF and IF$ conditional assignment statements should not be confused with $IF compiler directive.  The IF and IF$ statements are executed as needed.  The $IF compiler directive is executed once when the equations are compiled

 

Mathematical functions