Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site noscvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!talcott!panda!genrad!decvax!ittatc!dcdwest!sdcsvax!noscvax!johnson From: johnson@noscvax.UUCP (Timothy A. Johnson) Newsgroups: net.micro,net.micro.cpm,net.lang.pascal,net.micro.pc Subject: Re: Turbo Pascal Version 3.00 Message-ID: <120@noscvax.UUCP> Date: Fri, 22-Nov-85 20:29:31 EST Article-I.D.: noscvax.120 Posted: Fri Nov 22 20:29:31 1985 Date-Received: Mon, 25-Nov-85 07:23:55 EST References: <2258@umcp-cs.UUCP> Distribution: net Organization: Naval Ocean Systems Center, San Diego Lines: 65 Xref: watmath net.micro:12827 net.micro.cpm:4924 net.lang.pascal:394 net.micro.pc:5992 > Replace this line with your compiler bug > > I sat down to write the program for the next project I am going > to give to my Computer Science I class at home on my CPM system > with Turbo Pascal Version 3.00. The following program illustrates > the problem with the program I wrote: > > program junk(input,output); > procedure proca(chita:char); forward; > procedure procb(chitb:char); > begin > writeln('Entering procb with a ',chitb); > proca('A'); > writeln('Leaving procb with a ',chitb); > end; > procedure proca; > begin > writeln('Entering proca with a ',chita); > if chita = 'I' then procb('I'); > writeln('Leaving proca with a ',chita); > end; > begin > proca('I'); > end. > > The output using Turbo Pascal was: > > Entering proca with a I > Entering procb with a I > Entering proca with a A > Leaving proca with a A > Leaving procb with a I > Leaving proca with a A > > While the output for the same program on a VAX with BSD UNIX, > IBM VM/SP CMS, or a Macintosh with MacPascal was: > > Entering proca with a I > Entering procb with a I > Entering proca with a A > Leaving proca with a A > Leaving procb with a I > Leaving proca with a I > > as I expected. Calling Borland Technical Support was no help, > as they wanted a copy of the program on an IBM format disk. > The technical support specialist asked me to send a copy of the > program on a disk. When I asked "in what format?" she replied > "IBM, of course." I guess CPM does not exist anymore. > > Obviously, I was quite surprised at the output, and now I > wonder how they tested the compiler. It seems that a program > as simple as the one above should have been tested. > > -- Stanley Dunn > University of Maryland Department of Computer Science Under the PC-DOS version of Turbo 3.0, the program runs correctly with the same output as you have given for the other Pascals. The problem may be associated with the CP/M-80 Compiler Directive "A". The default is "A+" which inhibits recursive code. Switching to "A-" may solve your problem. This is documented on or about page 318 in the 3.0 manual. Timothy A. Johnson Computer Sciences Corporation