Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!ut-emx!reeder From: reeder@ut-emx.UUCP (William P. Reeder) Newsgroups: comp.lang.fortran Subject: Re: length of a character string Summary: never mind Keywords: null string, intrinsic function LEN Message-ID: <18603@ut-emx.UUCP> Date: 19 Sep 89 21:50:39 GMT References: <18585@ut-emx.UUCP> Organization: University of Texas Computation Center Lines: 29 In article <18585@ut-emx.UUCP>, I wrote: > The best idea I have come up with so far for creating a "null" string > is this: > > character*80 null > write ( null, * ) > > Does anyone have any better ideas? Well, after a little more thought (and then someone wrote me a letter with the same thoughts), it becomes clearer that FORTRAN has BLANK strings, not NULL strings. I came to this conclusion by thinking about how character strings are compared with relational operators: shorter strings are considered to be padded to the longer length with blanks. So, all I have to do is change if (ncar.eq."") then with if (ncar.eq.' ') then and everything is hunky-dory and standard conforming (except for those lower-case letters :-). Thanks for your time. -- William "Wills" Reeder, The University of Texas at Austin, Computation Center reeder@emx.utexas.edu, uunet!cs.utexas.edu!ut-emx!reeder, (512)471-3241 DISCLAIMER: Opinions expressed above are those of the author and do not necessarily reflect the opinions of The University of Texas at Austin, or those of the manufacturer of the wires which carried this message.