Path: utzoo!utgpu!watserv1!watmath!att!pacbell.com!ucsd!swrinde!cs.utexas.edu!helios!summa.tamu.edu!mkh6317 From: mkh6317@summa.tamu.edu (HOWARD, MATTHEW KENDALL) Newsgroups: comp.lang.fortran Subject: Equivalencing Characters Laid to Rest Message-ID: <11514@helios.TAMU.EDU> Date: 25 Jan 91 22:23:41 GMT Sender: usenet@helios.TAMU.EDU Reply-To: mkh6317@summa.tamu.edu Organization: TAMU Lines: 23 News-Software: VAX/VMS VNEWS 1.3-4 I'd like to collectively thank those individuals who took the time to kindly explain why equivalencing a character variable to a numeric variable violates the standard. In short, portability. Word length can vary from machine to machine for both numeric and character variables. A real variable may require 32 bits on one machine and 64 bits on another. Thus, alignments made using equivalence statements many not hold following a port. Furthermore, since machines have different rules about aligning variables in core relative to word boundaries, single byte elements, (a single character for example), might be stored in byte 1 of a 4 byte machine word on one machine and in byte 2 or 4 on another. And as an aside to the original I/O article. Since the internal representation of characters may differ from one platform to another (ACSII vs. EBCDIC for example), attempting to manipulate character values via numeric assignments is also potentially non-portable. Of course we all do it anyway. Matt