🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #356

Re: Two Cobol Questions

#356
From: Alan Fargusson
Date: Thu, 27 Jul 1989 20:13
33 lines
1651 bytes
In article <1989Jul25.145219.22172@jarvis.csri.toronto.edu>, norvell@csri.toronto.edu (Theodore Stevens Norvell) writes:
> Perhaps this is not the right newsgroup, but if there is a Cobol group,
> we don't get it here.
> 
> (0)  Some languages (notably Pascal) allow non-local gotos.  That is, gotos
>      that jump out of the current procedure.  Does Cobol? If so what is
>      its semantics?  For example does the following control structure have
>      a well defined semantics when foo is true?
> 
>      a
> 	 perform b through c.
> 	 stop run.
>      b
> 	 perform d through e.
>      c
> 	 exit.
>      d
> 	 if foo then goto c.
>      e
> 	 exit.
> 
>      What if there is a goto e just before the stop run?  Does control
>      pass to c after e?!?
>      

Cobol does not have procedures like Pascal.  Basicly you can goto anywhere
in the program.  However, the standard is not specific enough about the
side effects of the perform through.  Many compilers will not do the right
thing with the above program.  They will tend to go into a loop, going
back to 'c' and falling into 'd'.
- - - - - - - - - - - - - - - - - - - - -
Alan Fargusson		Sun Microsystems
alanf@sun.com		..!sun!alanf
Technical Details
Message-ID: <118156@sun.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!apple!sun-barr!newstop!sun!smile!alanf
References: <1989Jul25.145219.22172@jarvis.csri.toronto.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!apple!sun-barr!newstop!sun!smile!alanf
From: alanf%smile@Sun.COM (Alan Fargusson)
Newsgroups: comp.lang.misc
Subject: Re: Two Cobol Questions
Message-ID: <118156@sun.Eng.Sun.COM>
Date: 27 Jul 89 20:13:38 GMT
References: <1989Jul25.145219.22172@jarvis.csri.toronto.edu>
Sender: news@sun.Eng.Sun.COM
Lines: 33