Thursday, January 8, 2009

sun IDM Xpress Langauge <and> and <or>



The function is a logical function and evaluates in the context of true and false (1 and 0).
Below provided two examples of the and function.

In the first example, the String, 42, is compared to a null value. The second value
is null, therefore the entire expression returns an integer of 0 (which is considered false).

In the second example, the integer, 42, is compared with a string value of 45.
The string value, <s>45</s> is not a null string so it is considered to be
true in the context of logical operations. The and expression returns the last value
cnsidered to be true if all expressions evaluate to true, therefore, this expression returns the string, "false".


<and>
<s>42</s>
<null/>
</and>----------> returns 0

<and>
<s>42</s>
<s>45</s>
</and> ---------------> returns 45



<or> – Takes any number of arguments and returns zero if all of the argument values are logically false. It returns the first argument that results in a logically true value

see the example below

<or>
<i>o</i>
<null/>
</or>-------> returns 0

<or>
<i>0</i>
<s>47</s>
<s>45</s>
<or>-----> returns 47



No comments:

Post a Comment