For Programmers: Free Programming Magazines  


Home > Archive > Cobol > August 2007 > Re: ALTER design (Was: Code problems with Perform Thru Exit causes fallthrough)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: ALTER design (Was: Code problems with Perform Thru Exit causes fallthrough)
Alistair

2007-08-01, 7:55 am

On 31 Jul, 16:46, "tlmfru" <la...@mts.net> wrote:
> LX-i <lxi0...@netscape.net> wrote in message
>
> news:4MWdnUDRHLIlPTPbnZ2dnUVZ_h2pnZ2d@co
mcast.com...
>
>
> <snip>
>
>
> An example that struck me as sensible at the time was to handle EOF in an
> out-of-line file read: it's a long time ago so I don't recall the exact
> details but it was something like this:
>
> READ.
>
> READ FILE AT END MOVE HIGH-VALUES TO FILE-KEY
> ALTER READ TO PROCEED TO READ-X
> GO TO READ-X.
> (A bunch of other code)
> READ-X.
> EXIT.
>


IIRC, the ALTER verb requires that the subject being ALTERed be a
paragraph containing only the GO TO verb so you need to do:

> READ.
> GO TO READ-B.
>
> READ-B.
>
> READ FILE AT END MOVE HIGH-VALUES TO FILE-KEY
> ALTER READ TO PROCEED TO READ-X
> GO TO READ-X.
> (A bunch of other code)
> READ-X.
> EXIT.
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com