Advanced use of the BOUND function

Let's see some advanced uses of the BOUND functions.

As stated in the paragraph about the IF Construct, the IF expression assessment system runs the following operation

* + *.

but, for several reasons, this expression might not give the correct result, for example when the cannot be evaluated (for example, an account is compared to a constant) or the , the and the have not homogeneous operands.

In these cases, in order to have a correct result, it is necessary to use the BOUND function and write

[LO].[X00000] := Bound ([D00000] + [E00000], @bound, if [C00000] == 0 then [D00000] else [E00000] end);

  • [C00000](1-[D00000])

By using the BOUND function it is possible to calculate the correct result for all the combinations in which D00000 is not defined. For example, if we write

[LO].[X00000] := Bound([C00000], “bound”, @bound * (1 – [D00000]));

the result will be C00000 for all the combinations in which D00000 does not exist. This result is got only using the BOUND function which allows to deploy the domain of D00000 in accordance with the one of C00000.

In this example we have used the C00000 account as BOUND expression . Using an account belonging to an assignment as BOUND expression is not mandatory, but you can use any defined account.