Contents | Prev | Next | Index


Relational Operators

= equal
<> unequal
< less
<= less or equal
> greater
>= greater or equal
IN set membership
IS class type test

Relations yield a BOOLEAN result. The relations =, <>, <, <=, >, and >= apply to operands of basic types, of enumerations, of subranges, and of string types. Relations = and # also apply to operands of set types, of pointer types, and of procedure types (including the value NIL). x IN s stands for "x is an element of s". x must be of a value of the set base type of s, and s of a set type. v IS C stands for "the dynamic type of v is C (or an subclass of T)" and is called a type test, where v is a variable of declared class type T.

The following are examples of expressions (refer to examples in the section about variable declarations):

1991 INTEGER
i DIV 3 INTEGER
~p OR q BOOLEAN
(i+j)*(i-j) INTEGER
s-[8,9,13] SET
i+x REAL
a[i+j]*a[i-j] REAL
(0<=i) & (i<100) BOOLEAN
t^.key = 0 BOOLEAN
k IN [i..j-1] BOOLEAN
w[i].name <= "John" BOOLEAN

 


Contents | Prev | Next | Index

Canterbury Pascal for JVM  (Last documentation update Sep 02, 2004)
Copyright © 1999-2004 J.Neuhoff - mhccorp.com  . All rights reserved.
Please send any comments or corrections to neuhoff@mhccorp.com