On comp-fortran-90, Van Snyder wrote:
> I exdent my EXITs to the level of the block they refer to, in order to
> expose the control flow more clearly. With a "block" and an EXIT that
> can refer to it, and my indenting/exdenting style, Loren's example
> would become:
>
> outer: block ! or whatever spelling is most agreeable
> inner: do i = 1, list_length
> if ( list(i) == search_key ) then
> ! Update
> exit outer
> else if ( list(i) > search_key ) then
> ! Need to insert
> exit inner
> else
> ! continue searching
> end if
> end do inner
> ! Need to insert
> ! Do the insert
> end block outer
There might be a problem with this BLOCK syntax. Consider the
following:
data: block
....
end block data
Then END BLOCK DATA could have two different meanings according to the
context. It is better to have unambiguous statements.
--
Michel Béland [log in to unmask]
professionnel de recherche tél: (514) 369-5223 fax: (514) 369-3880
CERCA (Centre de recherche en calcul appliqué)
5160, boul. Décarie, bureau 400(423), Montréal (Québec), Canada, H3X 2H9
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|