Download FormPort Designer Users Guide

Transcript
Chapter 5: Scripting Commands
OR
OR will return a value of True (1) if at least one of the two logical
arguments are true. A False (0) value will only be returned if all arguments
are false.
Arguments within this function must evaluate to either True (1) or False
(0). Complex formulas can return False (0), True (1) or greater than “1”
(True).
Syntax:
OR ( logical_cond1, logical_cond2 )
logical_cond1
Two conditions and may be complex formulas.
logical_cond2
Example
Consider the following formula:
IF(OR(EXACT(SPOOLTEXT(1,29,1,1),”*”),FIND(“#”,SPOOLTEXT(1,
29,92,1))=10 ), ”Line starting with * or has # character at position 10”,
“Detail line”)
The SPOOLTEXT function reads the first character of line 29 in the spool
file.
This character is then compared with “*,” and if equal returns a value of
True. In the second part of the OR function, SPOOLTEXT reads line 29
and searches for the character “#.” If this character is found at position 10
(as specified in this particular formula), then the second part of the OR
function returns True. As you can see, in this case the OR function returns
True only if the first character of the specific line is “*” and if there’s a
“#” character at position 10.
The OR function can also be nested to test more than 2 conditions, as
shown in the following formula:
OR( OR( x1 > 10 , x1 < 5 ), OR ( y1 > 15 , y1 < 10 ) )
Where x1 and y1 are valid numeric values.
Capella Technologies, Inc.
143