HP Pascal/iX Reference Manual (31502-90022)

4-: 15
TRUE
TRUE
FALSE
TRUE
Concatenation Operator
The
concatenation operator
+ concatenates two operands that may be string
variables, string literals, function results of a string type, or some
combination of these types. The result of the concatenation is always
type string.
NOTE It is not legal to use the concatenation operator in a constant
definition.
Example
VAR
s1,s2: string[80];
BEGIN
s1:='abc';
s2:='def';
s1:= s1 + s2; { s1 is now 'abcdef' }
writeln('s1 has: ',s1);
s2:= 'The first six letters are ' + s1;
writeln('s2 has: ',s2);
END.
Output:
s1 has: abcdef
s2 has: the first six letters are abcdef
SET Operators
The
set
operators perform set operations on two set
operands
. The result
is of type set. The set operators are +, -, and *. Operands used with
set operators may be
variables, constant identifiers,
or
set
constructors
. The base types of the set operands must be type compatible
with each other.
OPERATOR RESULT
+ (union) A set whose members are all the elements present in
the left set operand and those in the right,
including members present in both sets.
- (difference) A set whose members are the elements which are
members of the left set but are not members of the
right set.
* (intersection) A set whose members are only those elements present
in both of the set operands.
Example
PROGRAM show_setops;
VAR
a, b, c: SET OF 1..10;
x : 1..10;
BEGIN