I've danced around with this concept and I gotta play the CPU card that so
many people harp on.

Considering that you are using this method because you are appending a vast
amount of data, you are cycling through the FOR...NEXT loop a gazillion
times. Thus, you are processing the statement [EMAIL PROTECTED] a gazillion
minus 1 times more than what's necessary.

I have felt the progressive dragging effect when using <-1> for your
mentioned reasons. I've also heard that there is a difference between <-1>
and <1,-1> as the <-1> is interpreted as a true append while the <1,-1> is a
little slower. The reason that I understand is that appending on the
valuemark level doesn't assume that the attribute being appended is the last
one. You can have a 10 attribute record and have <5,-1> a gazillion times.

Another method that I use when building a large dynamic array (assuming that
it's going to be written somewhere) is to create a large DIM variable, say
DIM OUT(100000) and increment a index pointer. Then I MATWRITE OUT and be
done with it.

This is particularily helpful when building a large HTML, TXT or CSV
document in MV. If you have direct access to the network folder, then this
is useful. I don't tend to get WRITEV'ly in MV as I can with PC languages
that can WRITE appendingly to an open file, thus not feeling the extent of
the duration. There might be some OSAPPEND statement with its other OS
brothers. I've only used OSREAD or OSWRITE for the whole records.

I guess the jury is still out on the balance between EXTRACT <> or REMOVE.

Thanks
Mark Johnson
----- Original Message -----
From: "Baakkonen, Rodney A (Rod) 46K" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, March 05, 2007 12:39 PM
Subject: RE: [U2] Universe vs. Unidata


> On Unidata, I saw a Unibasic tips write up from long ago. It said
concatenation was faster than using a <-1> to build an array. The speed came
from the fact that Unidata knew where the end of a variable was. So using
concatenate, the process could jump to the end of the variable to add an
element to the array. Where as <-1> had to traverse the entire array from
the beginning every time. I don't know if this still holds true. But I still
use the practice.
>
> ARRAY = ''
> DELIM.VALUE = ''
> FOR VC = 1 TO SOME.VALUE.COUNTER
>     (some processing to get a THE.NEXT.VALUE set)
> ARRAY := DELIM.VALUE:THE.NEXT.VALUE
> DELIM.VALUE = @AM
> NEXT VC
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of MAJ Programming
> Sent: Monday, March 05, 2007 11:12 AM
> To: [email protected]
> Subject: Re: [U2] Universe vs. Unidata
>
>
> Please share what you consider 'Good Programming Practices'.
>
> I've inherited thousands of programs during my decades with MV and I have
> some methods that I like and many that I don't. I'm interested in another
> programmers opinions.
>
> In particular, I thought that EXTRACT was not taught anymore as the <>
> nomenclature works as well. I use the <> construct incredibly often except
> when I know that I am dealing with a dynamic array to parse through and it
> may contain 10,000's of rows. Then REMOVE is by and large the more
> effecient. I would not want to use REMOVE for simple data field
extractions.
> I use REMOVE for EDI or other parsing projects.
>
> REMOVE proved incredibly faster than <> or EXTRACT with large files. That
> was on a D3-W2K system if you're keeping score.
>
> Thanks
> Mark Johnson
>
> BTW, I wrote a utility that will convert the functions EXTRACT, DELETE and
> REPLACE with their equivilent <> forms in any source code. I leave INSERT
> alone as its <> replacement is too platform specific.
> ----- Original Message -----
> From: "Stevenson, Charles" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Monday, March 05, 2007 11:13 AM
> Subject: RE: [U2] Universe vs. Unidata
>
>
> > Thanks, Drew.  My bet's riding on REMOVE.
> >
> > > I hope some have found this information helpful.  If I get
> > > the chance, I'll try to do a more thorough testing of the
> > > various dynamic array extraction methods  (EXTRACT vs REMOVE,
> > > primarily) on each platform to help identifiy good
> > > programming practices.
> > -------
> > u2-users mailing list
> > [email protected]
> > To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
> -------
> u2-users mailing list
> [email protected]
> To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to