Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.dal.ca!silvert From: silvert@cs.dal.ca (Bill Silvert) Newsgroups: comp.lang.fortran Subject: Re: RE : MSFORTRAN - bugs !!!! Summary: CHARACTER*(*) Message-ID: <1990Apr13.205055.23252@cs.dal.ca> Date: 13 Apr 90 20:50:55 GMT References: <1990Apr11.144430.26803@sun.soe.clarkson.edu> Sender: silvert@cs.dal.ca.UUCP (Bill Silvert) Reply-To: bill@biomel.UUCP Organization: Habitat Ecology Div., Bedford Inst. of Oceanography Lines: 34 In article maine@elxsi.dfrf.nasa.gov (Richard Maine) writes: >On 11 Apr 90 14:44:30 GMT, pdy@sun.soe.clarkson.edu (P. D. Yapa) said: >Pooji> I had trouble passing a string variable though >Pooji> subroutine arguments. It never works on MSFORT >Pooji> c --- main prog >Pooji> character *8 fnm >Pooji> call opnfil('ross.fnm') >Pooji> --------- >Pooji> subroutine opnfil(fnm) >Pooji> character *8 fnm [... much deleted ...] >characters and it makes no sense to have fewer, it is better to write >the code as > ----- > subroutine opnfil(fnm) > character fnm*(*) > --- Exactly. Although I have never used the fixed-length format in the original example, I have thousands of lines of code that do extensive string passing, and no Fortran-77 compiler has ever choked on a declaration of the form of: SUBROUTINE SUB(STRING) CHARACTER*(*) STRING and I can see no need to specify fixed-length strings (an exception that I have used successfully is a string of length one). -- William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2. Tel. (902)426-1577 UUCP=..!{uunet|watmath}!dalcs!biomel!bill BITNET=bill%biomel%dalcs@dalac InterNet=bill%biomel@cs.dal.ca