Being from the late 70's MCD crowd, I recall learning EXTRACT, INSERT,
DELETE and REPLACE functions for dynamic arrays. The fact that READ
co-existed with MATREAD begs some analysis on why there would be 2 methods
to get data from a data file.

In my travels through thousands of lines of code from that Jurrasic Pick
era, I've concluded that people didn't like typing EXTRACT with its required
but useless trailing parameters. Thus constantly typing

PRINT EXTRACT(CUST.REC,1,0,0)"L#20":" ":EXTRACT(CUST.REC,2,0,0)"L#20"

got to be a real pain in the neck. And if a field was to be accumulated, it
looked like this:

CUST.REC=REPLACE(CUST.REC,5,0,0,EXTRACT(CUST.REC,5,0,0)+INV.AMT)

My fingers hurt just typing this example. Imagine programming this way.

This was all before the <> characters for dynamic array extraction and the
semi-colon to eliminate the trailing useless zeros. I actually had a utility
that replaced the REPLACEs and other old-school expressions with their <>
counterparts when working on this older code.

So along comes REC(100) and PRINT REC(1)"L#20":" ":REC(2)"L#20 which saved
endless blisters. But you still had to use EXTRACT to get at the
multi-values of a field, Thus you had:

PRINT EXTRACT(REC(5),1,MV,0)

with the hope that the person put the MV expression in the proper slot. This
brought about some creative alternatives to EXTRACT, the most prevelant was
FIELD. Thus you had

VM=CHAR(253)
PRINT FIELD(REC(5),VM,MV)

which was a slight improvement over EXTRACT.

Putting data back was another expression of rampant creativity. I've seen
code that READs in a REC and parses it to an ARRAY() to print the elements
simply. Was MATREAD not available at the same time as READ. I've also seen
code with 20-30 consecutive READV's to put the data in program-level
variables and then only WRITEV the changes.

But my favorite idiotic method had to be this line building an order record:

WRITE CUSTNO:AM:ORD.DATE:AM:PRODS:AM:QTYS:STR(AM,15):SALESMAN ON F.ORDER,
ORN

IMHO (here come the flames) I've concluded that the only benefit of using
REC(100) versus REC<> is if your system is based on using EQUATES to assign
the elements of REC(1-100) to program-level variable names, ie the alias
purpose of EQUATE. If these EQUATEs are part of an application-wide INCLUDE,
then that's even more consistent. But if the actual variable names vary
between program then it's created more trouble than they're worth. Consider
one program with:

EQUATE CUST.NAME TO CUST.REC(1)
and another with
EQUATE CUSTOMER.NAME TO CUSTOMER.REC(1)

So any value gained with consistent names is lost as you have to memorize
multiple expressions for (1). The only consistent thing is that it's field
1. You cannot mis-type '1' if you mean '1'.

In conclusion, like other subjective versions of MV programming, you use
what you learned or are good with. Personally, I don't use REC(100) for data
records. I use REC(100) for intermal programming when I've exceeded the
dynamics of dynamic arrays or for file handles. Maybe if I managed 200-300
user systems then the nanosecond differences would make a difference. But
for my collection of many 20-60 user clients, I see no difference.

My 6 cents.
Mark Johnson


----- Original Message -----
From: "Larry Hiscock" <[EMAIL PROTECTED]>
To: <u2-users@listserver.u2ug.org>
Sent: Saturday, May 14, 2005 5:42 PM
Subject: RE: [U2] Dymanic vs Dimensioned


> I don't recall InfoBasic dynamic arrays ever being limited to 1 or 2
> dimensions, but then, I didn't start working with PI until the early 80's.
> As far back as I can recall ('79 or so, on a Microdata Reality system)
> dynamic arrays supported three dimensions.
>
> So, enlighten me :-D
>
> Larry Hiscock
> Western Computer Services
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Stevenson,
Charles
> Sent: Saturday, May 14, 2005 8:24 AM
> To: u2-users@listserver.u2ug.org
> Subject: RE: [U2] Dymanic vs Dimensioned
>
> >From: Clifton Oliver
> > >  "Always remember that you should never believe any rule containing
> the
> > >  words 'always' or 'never'".
>
> Its corollary:
>
>    "All truth is relative."
>
> and
>
>    "We will not tolerate intolerance."
>
> taught in all seriousness by Postmodern liberal arts professors.
> And exactly opposite of what moderns as diverse as Patrick Henry and
> Voltaire would say:
>
>    "I disagree with you, but defend your right to believe it."
>
> > I was always amused to see which ones caught that and which ones just
> wrote
> >  it down in their notes.
>
> But, Clif, I would think _most_ of your students came with BSs not BAs.
> Like I said, most of this POSTmodern stuff comes from the Liberal Arts
side
> of academe.  The colleges of sciences cannot be so cavalier.  They accept
> the Enlightenment (modern) notion that there is an external reality, a
> notion that historically grew out of the Christian notion of a rational
> (thank-you, Greeks) transcendent God (thank-you, Hebrews) who created a
> rationally coherent universe (thank-you God;  as opposed for a mostly
> rational coherent UniVerse, thank-you Meeks & Herbert.  (It is strange how
> God's "universe" gets lowercased, where Meeks'&Herbert's gets capitalized
> (thank-you English).) ).
>
>   ----
>
> And now - to keep our beloved moderator, Chuck Barouch, from kicking this
> post into the shallow end of u2-community:
>
> Do you know why dimensioned arrays were first limited to only 1 or 2
> dimensions in Pick or Info-Basic?
>
> Would it be a terrible complication to the compiler to allow as many
> dimensions as the programmer needs?
>
> Whether or not dimensioned arrays are useful for manipulating stored data
> records, they have other legitimate uses.  But they would be much more
> useful if the programmer could specify as many dimensions as made sense in
> his application.
>
>
> Chuck "I'm not the Chuck who adds a quotation thing in the middle of his
> name" Stevenson
> -------
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> u2-users@listserver.u2ug.org
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to