gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [open-cobol-list] Re: 0 bytes in Cobol strings


From: William M. Klein
Subject: RE: [open-cobol-list] Re: 0 bytes in Cobol strings
Date: Tue Apr 6 20:29:21 2004

  When you say 

> -----Original Message-----
<snip>
> 
> The standard way of writing the null character would be to use
> X'' literal like this:
> 
>    VALUE '...' & X'000000000C'.
> 

I assume you are talking about the 2002 Standard.

In the '85 Standard, the "Standard way of doing this is exactly what was
originally reported, i.e. have a 
   VALUE "...."

where the "...." are ANY hex-value in the "computer's character set".  If
you are "dis-allowing" specific "control characters" (which MAY be
represented as HEX literals - so they are part of the computer's character
set) from being used in alphanumeric literals, then you are "violating" the
'85 Standard.

In fact, the 2002 Standard makes some distinctions  related to this.

 - For fixed format reference format, you STILL must allow EVERY "valid" hex
value within an alphanumeric literal - as long as the hex value represents a
character in the computer's "native" character set.

 - For FREE form reference format, the implementor MAY list specific
"control characters" (which indicate line feed, carriage control, ETC) which
may not be used in alphanumeric literals.

Bottom-line:
  In a conforming compiler ('85 or 2002 Standards) if you are using "fixed
reference format" (all that was available in '85),

  thou SHALT read all the characters from the column 1 thru the R-margin.
If a hex value occurs between and opening and closing literal delimiter,
then it is part of that literal.

Having said that,
  I know that there are several "workstation" (Windows, Unix, Linux)
compilers that have OPTIONS to treat CR-LF (or other control characters) as
control characters not part of literals - but they all (as far as I know)
have an ANSI/ISO conforming "mode" also where they are part of the literals.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]