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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

2.41 EXECUTE Statement<br />

EXECUTE name<br />

where:<br />

name<br />

is the name of a REMOTE BLOCK located in the same program unit.<br />

The EXECUTE statement allows a named block of code to be executed. The named block of code may be<br />

defined anywhere in the same program unit and is delimited by the REMOTE BLOCK and END BLOCK<br />

statements. Executing a REMOTE-block is similar in concept to calling a subroutine, with the advantage<br />

that shared variables do not need to be placed in a COMMON block or passed in an argument list. When<br />

execution of the REMOTE-block is complete (i.e., when the END BLOCK statement is executed), control<br />

returns to the statement following the EXECUTE statement which invoked it.<br />

Example:<br />

EXECUTE INCR<br />

PRINT *, ’FIRST’<br />

EXECUTE INCR<br />

PRINT *, ’SECOND’<br />

.<br />

.<br />

.<br />

REMOTE BLOCK INCR<br />

I=I+1<br />

PRINT *, ’I=’,I<br />

END BLOCK<br />

For more information, see the chapter entitled "Program Structure Control Statements" on page 193.<br />

EXECUTE Statement 73

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

Saved successfully!

Ooh no, something went wrong!