HP 3000 Manuals

PROGRAM Statement (Nonexecutable) [ HP FORTRAN 77/iX Reference ] MPE/iX 5.0 Documentation


HP FORTRAN 77/iX Reference

PROGRAM Statement (Nonexecutable) 

The PROGRAM statement defines the name of a program.  Optionally, as an
extension to the ANSI 77 standard, it also defines the formal arguments
of the main program in which the statement appears.

[]
----------------------------------------------------------------------------------------------- | | | | | Item | Description/Default | Restrictions | | | | | ----------------------------------------------------------------------------------------------- | | | | | name | Name of the program (and its main | None. | | | entry point). | | | | | | ----------------------------------------------------------------------------------------------- | | | | | parameter | Optional program argument. | Must be of type CHARACTER*N. | | | | | ----------------------------------------------------------------------------------------------- The PROGRAM statement must be the first noncomment statement in a module, except for certain compiler directives, described in Chapter 7 . The MPE/iX RUN command has two optional parameters, PARM and INFO, whose values you can pass to any FORTRAN 77 program. The PARM field is a 16-bit or 32-bit signed integer. The INFO field is a character string of up to 255 characters, including the apostrophes (') or quotation marks ("). You can obtain the values of PARM or INFO in a FORTRAN 77 program by specifying appropriate parameters in the PROGRAM statement. These parameters can specify a variable for PARM, a variable for INFO, or both. After placing the variables in the PROGRAM statement, you should declare the variables as the correct types. The variables must be local variables in the main program unit. The variable for PARM must be type INTEGER*2 or INTEGER*4. The variable for INFO must be a character variable, expressed as CHARACTER*(*). The PROGRAM statement can have at most two parameters and they must be used as mentioned above (but can be in any order). Examples Notes -------------------------------------------------------------------------------------- PROGRAM main Specifies main as the name of the program. PROGRAM main() Specifies main as the name of the program, with no arguments. PROGRAM runit(a,b) Specifies runit as the name of the program, and specifies its arguments as a,b. Note that one of these arguments must be an INTEGER*2 or INTEGER*4 and the other must be a CHARACTER*(*).


MPE/iX 5.0 Documentation