bottom

Boolean Functions

Boolean Functions

Boolean functions allow users to handle the calculation on values "true" and "false". They are usefull for the Control Functions and some Control Rules when conditions are used to decide which value to generate.

NOT(a) : boolean negation

Returns the negation of the boolean value a. Remember that is a is not a boolean value (true or false) then it will be evaluated false and the NOT operator will then returns true.

AND(b1,b2,...): boolean AND

This function takes a variable number of boolean parameters (at least one) and returns "true" if and only if every parameter is true and false otherwise. The first parameter that evaluates to false will be the last parameter evaluated.

Examples:

  • AND(true,EQUAL("Hello","Hello")) returns "true"
  • AND(false,INCR(x)) returns false and parameter x will never be incremented here

OR(b1,b2,...): boolean OR

This function takes a variable number of boolean parameters (at least one) and returns "true" if and only if at least one parameter evaluates to true and false otherwise.

Example:

  • OR("Hello",EQUAL("Hello","Hello")) returns "true" from the evaluation of the EQUAL function

LESS(n1,n2): number comparison (equiv to n1 < n2)

This function takes two numbers and returns true if and only if the numbers n1 is smaller than n2.

Examples:

  • LESS(2.5,3) returns "true"
  • LESS(3,4) returns "false"
  • LESS(3,3) returns "false"

EQUAL(n1,n2,...): equality

This function takes a variable number of parameters and returns true if and only if all parameters are syntactically equals.

Example:

  • EQUAL(HELLO,UPPER(hello),UPPER(Hello)) returns "true".
  • EQUAL(3.1225,3.12251) returns false

INLIST(v,n1,n2,...) : set membership

This function takes a variable number of parameters (at least 2) and returns true if and only if the parameter v appears in the list (n1,n2,...).

Example:

  • INLIST(a,c,vf,e,g,1,q,a,34) renvoie "true"

FEXISTS(filename) : file exists ?

This function returns true if a file with the given path name can be found in the user's data our output workspaces, or in one of the shared workspaces' data area. This is case sensitive

Examples:

  • FEXISTS("Output1.txt")

Add comment


Security code
Refresh