Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!purdue!haven!umbc3!mbph!hybl From: hybl@mbph.UUCP (Albert Hybl Dept of Biophysics SM) Newsgroups: comp.lang.fortran Subject: Re: Character aliases are Satanic exten Summary: Do ANSI committees communicate with each other? Message-ID: <596@mbph.UUCP> Date: 19 May 89 23:05:57 GMT References: <592@mbph.UUCP> <50500128@uxe.cso.uiuc.edu> <105003@sun.Eng.Sun.COM> <1515@hudson.acc.virginia.edu> Organization: University of Maryland, School of Medicine, Baltimore, MD 21201 Lines: 66 In article <1515@hudson.acc.virginia.edu> from gl8f@bessel.acc.Virginia.EDU (Greg Lindahl), Greg protests: >Thank you for posting my mail verbatim without asking first. Greg, to you, I extend my most sincere apology. >I often write mail off the top of my head; before I post I >double-check my information. Thank you for the flummery :-( I hope the dialogue that flows from my unintentional breach of etiquette will help identify the reasons why "Fortran 77 is weaker than other modern languages in its handling of character strings, ..." >... checking my _Aipsletter_ vol 8 # 3, a magazine >published by the AIPS people, I find that they recently did convert >their Satanic characters into a different form. That is good news. How does one subscribe to _Aipsletter_? >... just because all the computers you use >have the non-standard extension that character and other types can >coexist doesn't mean that the Standard says so. Sigh, the SVS-fortran compiler I am using doesn't allow character arrays or strings to exist in the same labeled common with integers and reals; this rates a 6.31 in the demolition derby. I would like to be able to do something like the following: PARAMETER (KMAX=a_big_number) PARAMETER (JMAX=4*KMAX) COMMON /ARCHIV/ ARRAY INTEGER*4 IARRAY(KMAX) REAL*4 ARRAY(KMAX) CHARACTER*(JMAX) DNA CHARACTER*1 AND(JMAX) EQUIVALENCE (IARRAY,ARRAY,DNA,AND) By using integer pointers, one could store or retrieve information from a large archival record containing mixed types. A simple WRITE N, ARRAY should copy the whole record to an I/O device. This allows a hacked dynamic storage scheme. The only problem is that it is not portable for many disparate reasons. First, as the _Aipsletter_ points out, the standard doesn't allow >"... character strings [... to] occur with other data types in, >for example, commons and I/O records ... " I have not encountered a computer that requires this separation because of any hardware limitation. Second, most implementations severely limit the length of a character string. Third, some implementations limit the number of bytes that can be written to a binary I/O record. RM-fortran on an IBM PC/AT limits a binary write to 1032 bytes; the XLA+ compiler on our AT&T 3B2 limits the length to 256 bytes. This renders the binary write statement impotent and hence gets rated at 3.87 in the demolition derby. I think it was short sighted of the X3J3 committee not to require implementors to use spanned records as defined in ANSI X3.27-1978 (pages 24-26). Don't the various ANSI committees communicate with each other? ---------------------------------------------------------------------- Albert Hybl, PhD. Office UUCP: uunet!mimsy!mbph!hybl Department of Biophysics Home UUCP: uunet!mimsy!mbph!hybl!ah University of Maryland CoSy: ahybl School of Medicine Baltimore, MD 21201 Phone: (301) 328-7940 (Office) ----------------------------------------------------------------------