:= doesn't care because a plain string has no concept of 'delimiters' therefore no pointers/position to track other than beginning and end. Agreed <-1> could be special cased to := BUT <3,-1> could not
-----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dave Laansma Sent: Thursday, July 12, 2012 11:15 AM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) I'm puzzled by '... doesn't care ...' terminology. Of course it 'cares' about pointers, it still has to get to the end of the 'string' one way or another. So, the question then is, does concatenation := establish and append to a 'string' faster than <-1>? And if so, why doesn't the database use the same logic for <-1> as it does for := since technically they're accomplishing the same thing? Sincerely, David Laansma IT Manager Hubbard Supply Co. Direct: 810-342-7143 Office: 810-234-8681 Fax: 810-234-6142 www.hubbardsupply.com "Delivering Products, Services and Innovative Solutions" -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Martin Braid Sent: Thursday, July 12, 2012 9:41 AM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) String concatenation will probably work faster since it doesn't care about pointers IF NEW.LIST#"" THEN NEW.LIST := @AM (or @VM if you want in the original format) NEW.LIST := UTILITY.ID Martin -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Dave Laansma Sent: 12 July 2012 14:20 To: Marco Manyevere; U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) This is the best solution, using REMOVE and building a new list instead of constantly 'shrinking' the original table. That being said, as NEW.LIST gets rather large, adding new elements to it can get 'time' consuming. Just like the REMOVE keeps track of the pointer as you spin through a table, I wish there was a comparable statement that kept track of the pointer as we added new elements <-1> to tables. Sincerely, David Laansma IT Manager Hubbard Supply Co. Direct: 810-342-7143 Office: 810-234-8681 Fax: 810-234-6142 www.hubbardsupply.com "Delivering Products, Services and Innovative Solutions" -----Original Message----- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Marco Manyevere Sent: Thursday, July 12, 2012 4:14 AM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) Is this what the OP is asking about or I'm missing something? The 2 code fragments look totally different. We dont know what's happening in GET.UTILITY.RECORD or the significance of UTILITY.NAME and LAST.NAME to totally eliminate them during the 'optimisation' I would rather do: NEW.LIST = '' LOOP REMOVE UTILITY.ID FROM KEY.LIST SETTING MORE WHILE MORE:UTILITY.ID GOSUB GET.UTILITY.RECORD IF INDEX(UTILITY.NAME,LAST.NAME,1) = 0 THEN CONTINUE NEW.LIST<-1> = UTILITY.ID REPEAT KEY.LIST = NEW.LIST NEW.LIST = '' ;* free the memory ________________________________ From: Kate Stanton <k...@walstan.com> To: U2 Users List <u2-users@listserver.u2ug.org> Sent: Thursday, 12 July 2012, 4:27 Subject: Re: [U2] trimming a list (a test of your ability) I am getting sucked in! NLST = "" ;* For new list MAXI = DCOUNT(KEY.LIST<1>,@vM) ;* Count items FOR INO =1 TO MAXI ;* Each key in list KEY.ID = KEY.LIST<1,INO> ;* A key ID LOCATE(KEY.ID,NLST,1;POS;'AL') ELSE ;* see if there INS KEY.ID BEFORE NLIST<1,POS> ;* Sort to list END NEXT INO ;* Check all keys On 12 July 2012 12:09, Wjhonson <wjhon...@aol.com> wrote: > > 1295 FOR DISPLAY.LOOP = 1 TO KEY.COUNT > 1296 UTILITY.ID = KEY.LIST<1,DISPLAY.LOOP> > 1297 GOSUB GET.UTILITY.RECORD > 1298 IF INDEX(UTILITY.NAME,LAST.NAME,1) = 0 THEN > 1299 KEY.LIST = DELETE(KEY.LIST,1,DISPLAY.LOOP,0) > 1300 DISPLAY.LOOP -= 1 > 1301 KEY.COUNT -= 1 > 1302 END > 1303 NEXT DISPLAY.LOOP > > > Comments? > > > _______________________________________________ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://listserver.u2ug.org/mailman/listinfo/u2-users > -- Kate Stanton Walstan Systems Ltd 4 Kelmarna Ave, Herne Bay, Auckland 1011, New Zealand Phone: + 64 9 360 5310 Mobile: + 64 21 400 486 Email: k...@walstan.com _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users Click https://www.mailcontrol.com/sr/wQw0zmjPoHdJTZGyOCrrhg== to report this email as spam. -------------------------------------------------------- Epicor Software (UK) is a limited company registered in England & Wales. Registration Number: 2338274. Registered Office: 6th Floor, One London Wall, London EC2Y 5EB This e-mail is for the use of the intended recipient(s) only. If you have received this e-mail in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not use, disclose or distribute this e-mail without the author's prior permission. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. Any views and/or opinions expressed in this e-mail are of the author only and do not represent the views of Epicor Software (UK) Limited or any other company within its group. This message has been scanned for malware by Websense. www.websense.com _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users