HP 3000 Manuals

Ch 4. Expressions [ HP Pascal/iX Reference Manual ] MPE/iX 5.0 Documentation


HP Pascal/iX Reference Manual

Chapter 4  Expressions 

An expression is a construct composed of operators and operands that
represent the computation of a result of a particular type.  In the
simplest case, an expression consists of a single operand with no
operator.

The type of an expression is known when the expression is written, and
never changes.  The actual value, however, may not be known until the
system evaluates the expression at run time.  It may differ for each
evaluation.

Constant expressions are a restricted class of HP Pascal expressions.
They must return a value that is computable at compile time.
Consequently, operands in constant expressions must be integers, reals,
longreals, or declared constants.  The operators used with constant
expressions must be +, -, *, DIV, or MOD. All other operators are
excluded.  Furthermore, only calls to the following standard functions
are legal:

   *   abs

   *   binary

   *   chr

   *   hex

   *   octal

   *   odd

   *   ord

   *   pred

   *   strlen

   *   succ

Syntax 

Expression:

[]
Selector:
[]
Example x:= 19; { Simplest case. "19" is the expression } { in the statement: "x := 19". } 100 + x; { Arithmetic operator with literal and } { variable operands. } (A OR B) AND (C OR D) { Boolean operator with Boolean operands. } x > y { Relational operator with variable } { operands. } setA * setB; { Set operator with variable operands. } 'ice'+'cream' { Concatenation operator with string } { literal operands. } x:= func1(B); { Function call }


MPE/iX 5.0 Documentation