Next: M2 Constants, Previous: M2 Operators, Up: Modula-2 [Contents][Index]
Modula-2 also makes available several built-in procedures and functions. In describing these, the following metavariables are used:
a
ARRAY
variable.c
CHAR
constant or variable.i
m
s
. The type of s
should be SET OF mtype
(where mtype
is the type of m
).n
r
t
v
x
All Modula-2 built-in procedures also return a result, described below.
ABS(n)
n
.CAP(c)
c
is a lower case letter, it returns its upper case equivalent, otherwise it returns its argument.CHR(i)
i
.DEC(v)
v
by one. Returns the new value.DEC(v,i)
v
by i
. Returns the new value.EXCL(m,s)
m
from the set s
. Returns the new set.FLOAT(i)
i
.HIGH(a)
a
.INC(v)
v
by one. Returns the new value.INC(v,i)
v
by i
. Returns the new value.INCL(m,s)
m
to the set s
if it is not already there. Returns the new set.MAX(t)
t
.MIN(t)
t
.ODD(i)
i
is an odd number.ORD(x)
x
must be of an ordered type, which include integral, character and enumerated types.SIZE(x)
x
can be a variable or a type.TRUNC(r)
r
.TSIZE(x)
x
can be a variable or a type.VAL(t,i)
t
whose ordinal value is i
.Warning: Sets and their operations are not yet supported, so
GDB treats the use of procedures
INCL
andEXCL
as an error.
Next: M2 Constants, Previous: M2 Operators, Up: Modula-2 [Contents][Index]