Be careful with remove if you are changing the original string. This is from the UniVerse manual on REMOVE.
The pointer is reset to the beginning of dynamic.array whenever dynamic.array is reassigned. Therefore, dynamic.array should not be assigned a new value until all elements have been extracted (that is, until variable = 0). Tom -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of George Gallen Sent: Monday, November 17, 2008 1:27 PM To: [email protected] Subject: RE: [U2] Speeding up processing through large dynamic table I believe that the later versions of UV does keep a current pointer, so the REMOVE shouldn't be much faster, as long as you don't write back to the dynamic array. George > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Joshua Gallant > Sent: Monday, November 17, 2008 1:31 PM > To: [email protected] > Subject: RE: [U2] Speeding up processing through large dynamic table > > > When running through an array with a for next loop the last item > processed isn't remembered so the program needs to traverse the entire > array for each record and will slow down as you get to > records later in > the process. > > Instead of this: > > A11 = DCOUNT(IN.TAB,@AM) > > FOR A1 = 1 TO A11 > IN.LINE = IN.TAB<A1> > SWAP @VM WITH @AM IN IN.LINE > CUST.NUM = IN.LINE<1> > CUST.DESC = IN.LINE<2> > NEXT A1 > > Try something like this instead: > > LOOP > REMOVE IN.LINE FROM IN.TAB SETTING MARK > SWAP @VM WITH @AM IN IN.LINE > CUST.NUM = IN.LINE<1> > CUST.DESC = IN.LINE<2> > WHILE MARK DO > REPEAT > > That will keep track of where you were in the array and pick up where > you left off. > > Let me know how that works out for you. > > Thanks, > Josh > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of David Laansma > Sent: Monday, November 17, 2008 1:10 PM > To: [email protected] > Subject: [U2] Speeding up processing through large dynamic table > > Is there a way to speed up spinning through a very large > dynamic table? > Here is > a sample of my program: > > A11 = DCOUNT(IN.TAB,@AM) > > FOR A1 = 1 TO A11 > IN.LINE = IN.TAB<A1> > SWAP @VM WITH @AM IN IN.LINE > CUST.NUM = IN.LINE<1> > CUST.DESC = IN.LINE<2> > NEXT A1 > > A11 is 85,000+ and as this loop goes on, this thing get really slow. > Any tips > on speeding this up? > ------- > 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/ __________ Information from ESET NOD32 Antivirus, version of virus signature database 3619 (20081117) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
