Scor­pio News

  

January–March 1987 – Volume 1. Issue 1.

Page 21 of 63

CONTINUE statement

This is normally used as the terminator of a DO loop. Although it is classified as an executable statement it really does nothing. It is very useful if the normal terminator of a DO loop is one of the forbidden statements (GOTO, STOP etc.)​since it allows the successful completion of the loop before control is logically transferred to the next line of the program. In the above example, statement label 14 could be altered to:

    PROD=PROD + A(I)
14  CONTINUE
    IF(PROD) 24,56,71
71  WRITE(5,100) PROD
          .
          .
    etc.

In this case control is passed to 71 and the value of PROD is printed if it is greater than 0.0; otherwise control is passed to another part of the program.

END statement

This is always the last statement in a FORTEAN program and its execution causes control to be passed to the system exit routine and thence to CP/M; it has the form:

END

and may have, optionally, a statement number.

CONCLUSIONS

This article was not intended to teach prospective users how to use FOR­TRAN, but to give intending users some idea of the way in which it can be used. A couple of books are worth mentioning which will give a more comprehensive coverage of the language. Wainwright and Grant’s contribution is quite handy since it treats BASIC and FOR­TRAN in parallel (there is a similar book for BASIC and PASCAL) but the book is poorly produced by Babani and includes a simple FOR­TRAN ‘interpreter’ written in Spectrum BASIC – a nasty bit of work with many errors. Alrock’s book is in the same mould as his original book on BASIC and is well worth getting if you like his style. I recommend it to all my students since it is infinitely more readable chan the majority of so-called text books on FOR­TRAN.

REFERENCES

Alcock, D, (1983) Understanding Fortran. Cambridge Univ. Press.

Wainwright, S.J end Grant, A. (1984) BASIC and FOR­TRAN in parallel. Babani.

Page 21 of 63