Subject: | |
From: | |
Reply To: | |
Date: | Thu, 6 May 2004 23:34:43 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
"Shahan, Ray" posted a question about what kind of code the COBOL compiler
generates for a condition-name condition where the condition-name is
associated with a range of values. Bill Cadier pointed out that HP COBOL
II/iX simply compares the value of the conditional variable against the end
values of the range. (If my wording sounds somewhat stilted, it's because,
as usual, I'm trying to use the precise terminology of the language
standard.)
Ray subsequently posted a more interesting example:
> 01 ACCEPTABLE-RANGE-SW PIC X(1) VALUE SPACES.
> 88 ACCEPTABLE-RANGE VALUE "A" THRU "J",
> "B" THRU "K".
In a case like this, the result of the test is true if the value of the
variable falls within any of the ranges specified (including the end
values). In each range, the first value specified must be less than the
second value specified, but there is no requirement that the ranges not
overlap.
In reading what the COBOL standard has to say about multiple ranges, I felt
that the wording was a little awkward, and I'll point that out to J4 for
possible rewording in the next revision of the standard.
Walter
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|