Re: Standard way to implement ASCII control chars
From: William M. Klein (wmklein_at_nospam.netcom.com)
Date: 12/09/03
- Next message: PeterSamson NewsGroups: "Client Server with MF?"
- Previous message: JerryMouse: "Re: Cobol2Java: a Cobol to Java source code converter is available for evaluation"
- In reply to: Tom Morrison: "Re: Standard way to implement ASCII control chars"
- Next in thread: Tom Morrison: "Re: Standard way to implement ASCII control chars"
- Reply: Tom Morrison: "Re: Standard way to implement ASCII control chars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 09 Dec 2003 21:23:31 GMT
Re:
"In this case the alphabet is NATIVE (ASCII), and the line feed character, the
value of which is X'0A', is the eleventh character in the 'ASCII alphabet.'
It should be noted that X"0A" is the 11th "character" in ANY computer character
set that supports all bit combinations from X"00" thru X"0A" - regardless of
what those bits MEAN. This is why using "11" in either the CHAR intrinsic
function or the SYMBOLIC CHARACTER phrase of the Special-Names paragraph will
allow a programmer to produce an X"0A" - even if that bit-pattern does NOT mean
"line-feed" on that computer. This is why either solution (where available)
will allow a program to create/use an ASCII "line feed" character - even in a
NON-ASCII environment.
-- Bill Klein wmklein <at> ix.netcom.com "Tom Morrison" <t.morrison@liant.com> wrote in message news:TvpBb.173$rf2.72364133@newssvr11.news.prodigy.com... > "Karl Kiesel" <Karl.Kiesel@fujitsu-siemens.com> wrote in message > news:3FD5ECE9.2F08B657@fujitsu-siemens.com... > > we would have proposed as a portable solution the definition of a > > 'constant' in special-names paragraph as > > SYMBOLIC CHARACTERS line-feed IS 11 > > (without an IN alphabet clause). > > Anything wrong with this solution, since nobody else did offer it ?? > > Karl, > > It is the correct solution, though it is normally overlooked. To expand a > bit: > > ENVIRONMENT DIVISION. > CONFIGURATION SECTION. > SPECIAL-NAMES. > SYMBOLIC line-feed IS 11. > ... > ... > DATA DIVISION. > WORKING-STORAGE SECTION. > 01 LF-CHARACTER PIC X VALUE line-feed. > ... > > The SYMBOLIC mechanism defines a symbolic (aka figurative) constant which > may be used in the manner of other predefined figurative constants (such as > SPACE). > > I will attempt to answer preemptively a follow-on question, "Why 11?" The > integer that is specified is the ordinal position of the character within > the alphabet. In this case the alphabet is NATIVE (ASCII), and the line > feed character, the value of which is X'0A', is the eleventh charater in the > 'ASCII alphabet.' > > Tom Morrison > Liant Software Corporation > >
- Next message: PeterSamson NewsGroups: "Client Server with MF?"
- Previous message: JerryMouse: "Re: Cobol2Java: a Cobol to Java source code converter is available for evaluation"
- In reply to: Tom Morrison: "Re: Standard way to implement ASCII control chars"
- Next in thread: Tom Morrison: "Re: Standard way to implement ASCII control chars"
- Reply: Tom Morrison: "Re: Standard way to implement ASCII control chars"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|