forlang.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Statement Function
                                             Up Contents Index Back
─────Statement Function ────────────────────────────────────────────────────
 
     Action
 
     Defines a function in a single statement.
 
     Syntax
 
     fname ( [ formals] )=expression
 
     Parameter          Description
 
     fname              Name of the function.
 
     formals            A list of formal arguments. Separate multiple
                        arguments with commas.
 
     expression         Any legal expression.
 
                        Statement functions cannot be called
                        recursively, either directly or indirectly.
 
     Remarks
 
     The type of <expression> and the type of <fname> must be
     compatible. <Expression> is converted to the same data type as
     <fname>.
 
     A statement function can only be referenced in the program unit
     in which it is defined.
 
     Example
 
         DIMENSION x(10)
         Add (a, b) = a + b
 
         DO 100, n = 1, 10
         x(n) = Add (y, z)
     100 CONTINUE
                                    -♦-