HP3000-L Archives

May 2004, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Walter Murray <[log in to unmask]>
Reply To:
Walter Murray <[log in to unmask]>
Date:
Thu, 6 May 2004 23:34:43 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (29 lines)
 "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 *

ATOM RSS1 RSS2