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.
ENTRY
                                             Up Contents Index Back
─────ENTRY ─────────────────────────────────────────────────────────────────
 
     Action
 
     Specifies an entry point to a subroutine or external function.
 
     Syntax
 
     ENTRY ename [ [eattrs] ] [([formal [ [attrs] ]
     [, formal [ [attrs] ] ] ...] ) ]
 
     Parameter          Description
 
     ename              The name of the entry point. If <ename> is an
                        entry point for a user-defined function,
                        <ename> must be given a data type.
 
     [eattrs]           A list of attributes for ename, separated by
                        commas. Valid attributes are: ALIAS, C, LOADDS,
                        PASCAL, VARYING.
 
     formal             A variable name or formal procedure name. If the
                        ENTRY statement is in a subroutine, <formal> can
                        be an asterisk.
 
     [attrs]            A list of attributes for <formal>, separated by
                        commas. Valid attributes are: FAR, HUGE, NEAR,
                        REFERENCE, VALUE.
 
     Remarks
 
     To begin executing a subroutine or function at the first
     executable statement after an ENTRY statement, replace the name
     of the subprogram or function with the name of the entry point.
 
     Parentheses are required when calling a function entry point,
     even if the function has no formal arguments.
 
     Entry points cannot be called recursively.
 
     The following restrictions apply:
 
        ■ Within a subprogram, <ename> cannot have the same name
          as a formal argument in a FUNCTION, SUBROUTINE, ENTRY,
          or EXTERNAL statement.
 
        ■ Within a function, <ename> cannot appear in any statement
          other than a type statement until after <ename> has been
          defined in an ENTRY statement.
 
        ■ If one <ename> in a function is of character type, all
          the <ename>s in that function that must be of character type,
          and all the <ename>s must be the same length.
 
        ■ A formal argument cannot appear in an executable statement
          that occurs before the ENTRY statement containing the formal
          argument unless the formal argument also appears in a
          FUNCTION, SUBROUTINE, or ENTRY statement that precedes the
          executable statement.
 
        ■ ENTRY cannot appear between a block IF and the
          corresponding END IF, or between DO and its terminal
          statement.
 
     Example
 
     C     This fragment writes a message indicating
     C     whether num is positive or negative
           IF (num .GE. 0) THEN
              CALL Positive
           ELSE
              CALL Negative
           END IF
           .
           .
           .
           END
 
           SUBROUTINE Sign
           ENTRY Positive
           WRITE (*, *) 'It''s positive.'
           RETURN
           ENTRY Negative
           WRITE (*, *) 'It''s negative.'
           RETURN
           END
                                    -♦-