Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!uw-beaver!ubc-cs!alberta!mts.ucs.UAlberta.CA!David_Halliwell From: userDHAL@mts.ucs.UAlberta.CA (David Halliwell) Newsgroups: comp.lang.fortran Subject: Re: integer variable format address Message-ID: Date: 6 Mar 91 01:19:33 GMT References: <6769@idunno.Princeton.EDU> Organization: MTS Univ of Alberta Lines: 28 In article <6769@idunno.Princeton.EDU>, hsbrown@lemmy.Princeton.EDU (Scott Brown) writes: >What is wrong with the following program? > program test > integer k > k=1 > write(*,k) > > 1 format('here is line 1') > end > > > >I have two FORTRAN books that suggest the write(*,k) >statement should work. I have two FORTRAN compilers >that give a bus error. Any ideas would be appreciated. Try: ASSIGN 1 TO K instead of K=1 The trick is you are not trying to store an arithmetic value in a variable. You are trying to associate a label (of the FORMAT statement) with the variable. The ASSIGN statement is what you use to do this. Hope this helps! (and is correct!) Dave Halliwell