Previous Topic Next topic Print topic


RETURNS

RETURNS is an entry name attribute that specifies that the entry value designates a function procedure that returns a value of data type t, where t is a list of attributes that specify a data type. Its format is:

RETURNS[(t)]; 

For example:

DECLARE F ENTRY(FIXED) RETURNS(POINTER); 
DECLARE G ENTRY(FLOAT)
      RETURNS(CHARACTER(32)VARYING);

In this example, F is declared as the name of a function procedure that returns pointer values. G is declared as the name of a function procedure that returns varying character-string values whose maximum length is 32 characters.

Any string length given in a RETURNS attribute must be an integer constant. The only attributes that can be given in a RETURNS attribute are data type attributes. DIMENSION or level numbers cannot be given, because functions cannot return arrays or structures.

Previous Topic Next topic Print topic