🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.f77
Article #286

Re: Minor I/O bug

#286
From: Tad Guy
Date: Tue, 24 Dec 1985 18:57
37 lines
1796 bytes
In article <3117@sdcc3.UUCP> Donald R. Fredkin (drf@sdcc3.UUCP) writes:
>The f77 compiler complains of a syntax error at the first line of the
>following program (4.2bsd on VAX, v2.0 on SUN):
>
>	write(6,10) (-1)
>10	format(i2)
>	end
>
>Removal of the parentheses around -1 cures the problem. This seems to violate
>section 12.8.2.2 of ANSI X3.9-1978, which states that an <output list item>
>can be "(5) Any other expression ..."

I haven't found a fortran compiler yet that will accept that line.  The
compiler sees the starting paran and is assuming that you are starting
an implied do loop:

	integer array(20), i
	write(6,10) (array(i),i=1,20)

And chokes since that isn't what you are doing.  I avoid using () around
lists in writes or reads for this reason and since I haven't found necessary
to use them.

A solution I was told about when I used WATFIV on an IBM 370 was to do this:

	write(6,10) +(-1)

or, more apropriate for your use:

	write(6,10) -(1)

It appears that the presence of a sign forces the element to be evualated
as a expression and not a implied-do-loop.

Hope this helps...
	...tad
	ihnp4!burl!icase!xanth!tadguy
Technical Details
Message-ID: <247@xanth.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!ittatc!dcdwest!sdcsvax!ncr-sd!ncrcae!ncsu!uvacs!xanth!tadguy
References: <3117@sdcc3.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 7/1/84; site xanth.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!ittatc!dcdwest!sdcsvax!ncr-sd!ncrcae!ncsu!uvacs!xanth!tadguy
From: tadguy@xanth.UUCP (Tad Guy)
Newsgroups: net.lang.f77
Subject: Re: Minor I/O bug
Message-ID: <247@xanth.UUCP>
Date: Tue, 24-Dec-85 13:57:40 EST
Article-I.D.: xanth.247
Posted: Tue Dec 24 13:57:40 1985
Date-Received: Thu, 26-Dec-85 04:09:39 EST
References: <3117@sdcc3.UUCP>
Organization: Old Dominion University, Norfolk, Va.
Lines: 37