24.11.2014 Views

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

Open Watcom FORTRAN 77 Language Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>FORTRAN</strong> Statements<br />

2.43 EXTERNAL Statement<br />

<br />

EXTERNAL p [,p] ...<br />

where:<br />

p<br />

is the name of an external procedure, dummy procedure or block data subprogram.<br />

The EXTERNAL statement identifies a symbolic name to be a dummy procedure or an external procedure<br />

and allows these names to be passed as an actual argument. In the following example, SAM, ERRRTN and<br />

POLY are declared to be external procedures.<br />

Example:<br />

EXTERNAL SAM, ERRRTN, POLY<br />

In the following example, F is declared to be an external procedure and is passed as such to subroutine<br />

SAM. If the EXTERNAL statement were eliminated then the variable F would be passed on to subroutine<br />

SAM since there is no way of knowing that F is an external function.<br />

Example:<br />

EXTERNAL F<br />

.<br />

.<br />

.<br />

CALL SAM( F )<br />

The appearance of an intrinsic function in an EXTERNAL statement declares that name to be an external<br />

procedure and the intrinsic function by that name is no longer available in that program unit. This allows<br />

the programmer to define a function by the same name as an intrinsic function. In the following example,<br />

the programmer’s SIN function will be called instead of the intrinsic SIN function.<br />

Example:<br />

EXTERNAL SIN<br />

.<br />

.<br />

.<br />

CALL SIN( .1 )<br />

A statement function name must not appear in an EXTERNAL statement. A name must only appear in an<br />

EXTERNAL statement once.<br />

EXTERNAL Statement 75

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!