Special names and methods


For convenience, NetRexx provides some special names for naming commonly-used concepts within terms. These are only recognized if there is no variable of the same name previously seen in the current scope (this allows the set of special words to be expanded in the future, if necessary, without invalidating existing variables). These names are not reserved; they may be used as variable names instead, if desired.

There are also two 'special methods' that are used when constructing objects, and constructors for the primitive types.

Special names

The following special names are allowed in NetRexx programs.

With the exception of 'length', the special names may only be used alone or as the first item in a compound reference.

Special methods

Constructors (methods used for constructing objects) in NetRexx must invoke a constructor of their superclass before making any modifications to the current object (or invoke another constructor in the current class).

This is simplified and made explicit by the provision of the special method names 'super' and 'this', which refer to constructors of the superclass and current class respectively. These special methods are only recognized when used as the first, method call, instruction in a constructor. See "Methods and constructors".

In addition, NetRexx provides special constructors for the primitive types that allow bitwise construction of primitives. For example:

  i=int 77
  c=char(i)    -- c is now the character 'M'
  j=int(c)     -- j is now the integer 77

Note that the conversion

  j=int c

would have failed, as 'M' is not a number. The argument to a primitive constructor must be a primitive.


[ previous section | contents | next section ]

From 'netrexx.doc', version 0.75.
Copyright(c) IBM Corporation, 1996. All rights reserved. ©