HP (Hewlett-Packard) HP 3000 Laptop User Manual


 
Appendix B 739
Expression Evaluator Functions
Expression Evaluator Features
Expression Evaluator Features
The two main types of expressions, which can be processed by the expression evaluator, are
numeric and string. In addition, Boolean expressions may be constructed using numeric
and string expressions (involving the comparison operators), Boolean operators, Boolean
functions, and Boolean variables.
A numeric expression may contain the following:
Variables containing numeric values or expressions
Unary operators: +,-
Bit manipulation operators: CSL, CSR, LSL, LSR, BOR, BAND, BNOT, BXOR
Exponentiation operator: ^
Algebraic operators: +, -,
, /, MOD
Comparison operators: >, <, =, >=, <=, <>
Parentheses: ( )
Functions returning numeric values: ABS(), LEN(), ORD(), POS()
Decimal digits, optionally preceded by #, consisting of 0..9
Hexadecimal digits, preceded by $, consisting of 0 .. 9, a .. f, A .. F
Octal digits, preceded by %, consisting of 0 .. 7
String expressions are comprised of the following:
Variables containing string values or expressions
Algebraic operators: +,-
Comparison operators: >, <, =, >=, <=, <>
Parentheses: ( )
Functions returning string values: STR(), LFT(), RHT(), CHR()
Quoted strings of the form 'string', "string", '', or "" (the last two refer to an empty
string)
String and numeric expressions resulting in Boolean values may be combined with each
other and with Boolean functions and variables using the logical operators AND, OR, XOR,
and NOT. Their Boolean values may also be compared with the equality, =, and inequality,
<>, operators. For example:
setvar a 1
setvar str2 'b'
setvar boolvar1 1=0
if (a=1)=('a'=str2) or boolvar1 then
EXPRESSION FALSE
endif