modula-2 home

  Home  
  Tutorial  
  Win32 API  
  Reference  
  Projects  
 

 

Appendix 1. Modula-2 standard procedures


ABS

The function ABS is used to obtain the absolute value of a value of a real number type or a whole number type.

The Function CAP

The function CAP is used to obtain the upper-case equivalent of a lower-case character for those characters that have such equivalents.

CHR

The function CHR is used to obtain the value of the character type that has a specified ordinal number.

CMPLX

The function CMPLX is used to obtain a value of a complex number type from a pair of expressions specifying its real and imaginary parts.

DEC

The procedure DEC is used to decrement the value of a variable that is of an ordinal type.

DISPOSE

The procedure DISPOSE is used to release an area of dynamically allocated storage that was earlier claimed by a call to the procedure NEW.

Use of this procedure requires that the identifier DEALLOCATE is visible at the point of the call of DISPOSE (you can import DEALLOCATE from the module STORAGE).

EXCL

The procedure EXCL is used to remove an element from a variable that is of a set type or a packedset type.

FLOAT

The function FLOAT is used to obtain a value of the real type from a value of a real number type or a whole number type.

HALT

The procedure HALT is used to terminate the execution of a program at a point other than the end of the program block.

HIGH

The function HIGH is used to obtain the upper bound of the index type of a one-dimensional open array formal parameter, or the upper bound of an index type of a multi-dimensional open array formal parameter.

IM

The function IM is used to obtain the imaginary part of a value of a complex number type.

INC

The procedure INC is used to increment the value of a variable that is of an ordinal type.

INCL

The procedure INCL is used to add an element to a variable that is of a set type or a packedset type.

INT

The function INT is used to obtain a value of the signed type from a value of an ordinal type or a real number type.

LENGTH

The function LENGTH is used to obtain the length of a string value.

LFLOAT

The function LFLOAT is used to obtain a value of the long real type from a value of a real number type or a whole number type.

MAX

The function MAX is used to obtain the maximum value of a scalar type.

MIN

The function MIN is used to obtain the minimum value of a scalar type.

NEW

The procedure NEW is used to obtain an area of dynamically allocated storage that is to be bound to a variable that is of a pointer type.

Use of this procedure requires that the identifier DEALLOCATE is visible at the point of the call of DISPOSE (you can import ALLOCATE from the module STORAGE).

ODD

The function ODD is used to determine whether a value of a whole number type is even or odd.

ORD

The function ORD is used to obtain the ordinal number of a value of an ordinal type.

RE

The function RE is used to obtain the real part of a value of a complex number type.

SIZE

The function SIZE is used to ascertain the amount of storage that is used for a variable of a particular type.

TRUNC

The function TRUNC is used to obtain a value of the unsigned type from a value of a real number type.

VAL

The function VAL is used to obtain a value of a specified scalar type from an expression of a scalar type.