At 12:12 on 13 January, Michael Metcalf wrote:
> You could use a nested IF...THEN sequence with repeated values:
>
> IF(index == 10) then
> stuff
> ...
> if(index >= 9) then
> more stuff
> ...
> if(index >=8) then
> and so on
>
> ENDIF
> ENDIF
> ENDIF
Doesn't work. (If index .neq. 10 nothing happens.)
Anyway, the issue is not to find a way to avoid the computed GOTO -- I
can do that. The neatest I have found is
do
stuff for index=1
if (index==1) exit
stuff for index=2
if (index==2) exit
...
exit
end do
That's OK, but it involves testing index many times. I consider that
the computed GOTO does the job more neatly and transparently.
--
Anthony Stone http://www-stone.ch.cam.ac.uk/
University Chemical Laboratory, Email: [log in to unmask]
Lensfield Road, Phone: +44 1223 336375
Cambridge CB2 1EW Fax: +44 1223 336362
|