Browse Prior Art Database

Do With - A High-Level Computer Programming Language Statement

IP.com Disclosure Number: IPCOM000119706D
Original Publication Date: 1991-Feb-01
Included in the Prior Art Database: 2005-Apr-02
Document File: 3 page(s) / 123K

Publishing Venue

IBM

Related People

Kreitzer, SS: AUTHOR

Abstract

Described is a computer programming language construct statement, called DO-WITH, which is designed to simplify the coding of many algorithms and functions to reduce program coding time, increase program readability and reduce programming logic errors.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 41% of the total text.

Do With - A High-Level Computer Programming Language Statement

      Described is a computer programming language construct
statement, called DO-WITH, which is designed to simplify the coding
of many algorithms and functions to reduce program coding time,
increase program readability and reduce programming logic errors.

      Typically, computer programming languages contain looping
constructs which execute a sequence of instructions repetitively.
Each time an instruction sequence is executed, a variable called
"loop index" is incremented or decremented by a fixed step value.
Three parameters are generally specified in a program loop construct:
a) the initial value of the loop index; b) the terminal value of the
loop index; and c) the amount by which the index will change after
each execution of the loop. As an example, in the Fortran and
C-language statements below, each statement defines a loop which
executes ten times, with the index variable going from one to ten in
increments of one:
   DO 20  I=1,10                for (I=1; I<=10; I++) {
                  .
                  .
            body of loop                  body of loop
                  .                             .
                  .                             .
        20 CONTINUE                      }
For each loop, I takes on the values: 1,2,3,4,5,6,7,8,9,10

      In the above examples, the index variable increments by one
following each loop cycle.  It is also possible to specify other
fixed step values for incrementing the loop index, such as +2, +5,
-3, ..., etc.  It is not possible, however, to specify a loop where
the index variable takes on values which are not related by a
constant step value. For example, in a program which tests memory
using the hexadecimal values  { 0, A5A5, 5A5A, 5555, AAAA, FFFF }, it
would be efficient to have a loop construct whose index would take on
these values.

      The concept described herein implements a loop construct,
called a DO WITH statement, in which the loop index is able to take
on any arbitrary set of values specified by the programmer.  The
statement would have a general syntax in a high-level language, such
as "C" or Pascal, as follows:
   DO WITH identifier = {value-list}   {vector}
Here, the identifier refers to a variable name for the loop index.
The next parameter can be either a value-list or a vector.
Value-list and vector refer to a list of values, or the contents of a
one-dimensional array, which will be sequentially stored into the
loop index following each execution of the loop.  The following is an
example of a loop whose index "i" will take on the hexadecimal
values: 0, A5A5, 5A5A, 5555, AAAA, FFFF:
   DO WITH i = 0, X'A5A5', X'5A5A', X'5555', X'AAAA', X'FFFF'
          ...