Built-In Func/Proc (Debugging with GDB)
From Get docs
Gdb/docs/latest/gdb/Built 002dIn-Func 002fProc
Next: M2 Constants, Previous: M2 Operators, Up: Modula-2 [Contents][Index]
15.4.9.2 Built-in Functions and Procedures
Modula-2 also makes available several built-in procedures and functions. In describing these, the following metavariables are used:
a- represents an
ARRAYvariable. c- represents a
CHARconstant or variable. i- represents a variable or constant of integral type.
m- represents an identifier that belongs to a set. Generally used in the same function with the metavariable
s. The type ofsshould beSET OF mtype(wheremtypeis the type ofm). n- represents a variable or constant of integral or floating-point type.
r- represents a variable or constant of floating-point type.
t- represents a type.
v- represents a variable.
x- represents a variable or constant of one of many types. See the explanation of the function for details.
All Modula-2 built-in procedures also return a result, described below.
ABS(n)- Returns the absolute value of
n. CAP(c)- If
cis a lower case letter, it returns its upper case equivalent, otherwise it returns its argument. CHR(i)- Returns the character whose ordinal value is
i. DEC(v)- Decrements the value in the variable
vby one. Returns the new value. DEC(v,i)- Decrements the value in the variable
vbyi. Returns the new value. EXCL(m,s)- Removes the element
mfrom the sets. Returns the new set. FLOAT(i)- Returns the floating point equivalent of the integer
i. HIGH(a)- Returns the index of the last member of
a. INC(v)- Increments the value in the variable
vby one. Returns the new value. INC(v,i)- Increments the value in the variable
vbyi. Returns the new value. INCL(m,s)- Adds the element
mto the setsif it is not already there. Returns the new set. MAX(t)- Returns the maximum value of the type
t. MIN(t)- Returns the minimum value of the type
t. ODD(i)- Returns boolean TRUE if
iis an odd number. ORD(x)- Returns the ordinal value of its argument. For example, the ordinal value of a character is its ASCII value (on machines supporting the ASCII character set). The argument
xmust be of an ordered type, which include integral, character and enumerated types. SIZE(x)- Returns the size of its argument. The argument
xcan be a variable or a type. TRUNC(r)- Returns the integral part of
r. TSIZE(x)- Returns the size of its argument. The argument
xcan be a variable or a type. VAL(t,i)- Returns the member of the type
twhose ordinal value isi.
Warning: Sets and their operations are not yet supported, so GDB treats the use of procedures
INCLandEXCLas an error.
Next: M2 Constants, Previous: M2 Operators, Up: Modula-2 [Contents][Index]