Re: [U2] trimming a list (a test of your ability)

2012-07-16 Thread Keith Johnson [DATACOM]
Universe gives a slight lead to <-1> too. Also, it compiles Y = Y:CHAR(254):I and Y := CHAR(254):I to exactly the same thing. I checked with VLIST and even edited the compiled code to be sure. ALSO (and this surprised me) it doesn't support ROUNDS *= 2 The documenation (Universe BASIC 2-25) on

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread Wjhonson
That sort of thing. Some of this may be by design, some by default, some kinda lookin like a bug. -Original Message- From: u2ug To: U2 Users List Sent: Fri, Jul 13, 2012 12:23 pm Subject: Re: [U2] trimming a list (a test of your ability) Oops - meant to say : I seem to remember

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread Wjhonson
-Original Message- From: u2ug To: U2 Users List Sent: Fri, Jul 13, 2012 12:20 pm Subject: Re: [U2] trimming a list (a test of your ability) Yep - I've run into that at some time as well. seem to remember this being a problem with the editor or with eading/writing values to a

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread u2ug
PM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) Yep - I've run into that at some time as well. I seem to remember this being a problem with the editor or with reading/writing values to an mv file rather than internal string handling. If you re-edit the sourc

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread u2ug
:CHAR(255):"CAT" ? -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Friday, July 13, 2012 1:49 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] trimming a list (a test of your ability) W

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread Wjhonson
;sort" of thing as other characters even if the editor does -Original Message- From: u2ug To: U2 Users List Sent: Fri, Jul 13, 2012 10:43 am Subject: Re: [U2] trimming a list (a test of your ability) Just to be complete : for j=0 to 255 if char(j)='x' then con

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread u2ug
; len=":l crt " pos=":p end next end j=0 x =[abcxyz] len=7 pos=5 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of u2ug Sent: Friday, July 13, 2012 1:10 PM To: U2 Users List Subject: Re: [

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread u2ug
quot;:x:"]" crt len(x) crt index(x,"x",1) end [abc xyz] 7 5 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Friday, July 13, 2012 12:27 PM To: u2-users@listserver.u2ug.org Subject

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread Wjhonson
ssage- From: dennis bartlett To: Marco Manyevere ; U2 Users List Sent: Fri, Jul 13, 2012 7:59 am Subject: Re: [U2] trimming a list (a test of your ability) Actually the way I wrote it the first time was correct but I needed to test or null x's i.e. z='' oop remove x from y

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread Wjhonson
constantly at the fore, but I'm willing to be edumacated on that abstruse point. (Or pointer) Will -Original Message- From: Wols Lists To: u2-users Sent: Fri, Jul 13, 2012 3:53 am Subject: Re: [U2] trimming a list (a test of your ability) On 12/07/12 16:15, Dave Laansma wrote:

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread dennis bartlett
te: > You must do "WHILE MORE:NEXT.ID" or "WHILE NEXT.ID:MORE" otherwise the > last NEXT.ID will not be processed > > > > > From: dennis bartlett > To: U2 Users List > Sent: Friday, 13 July 2012, 7:09 > Subject: Re:

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread Wols Lists
On 12/07/12 16:15, Dave Laansma wrote: > 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. Except that a string, as far as I am aware, uses the "pascal method" I think it's called - namely

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread Marco Manyevere
You must do "WHILE MORE:NEXT.ID" or "WHILE NEXT.ID:MORE" otherwise the last NEXT.ID will not be processed From: dennis bartlett To: U2 Users List Sent: Friday, 13 July 2012, 7:09 Subject: Re: [U2] trimming a list (a test of your abilit

Re: [U2] trimming a list (a test of your ability)

2012-07-13 Thread Brian Leach
: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David L. Wasylenko Sent: 12 July 2012 23:09 To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) JUST FOR FUN... I bumped the iteration count to 10,000,000 And the DIM BIG() to 10,000 Ran in

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread dennis bartlett
Hi Steven The REMOVE statement process a multivalued list. The SETTING clause will set the variable to either 3, or 2, or 1, or 0 depending on the value of the delimiter last encountered... 1 for @FM 2 for @VM 3 for @SM 0 for End Of String If the array consists only of @FM, then MORE

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread mhilbert
To continue along these lines, and if you want your code to be compact, if KEY.LIST were equal to RAISE(KEY.LIST) you could do this: NEW.LIST = "" SELECT KEY.LIST LOOP WHILE READNEXT UTILITY.ID DO GOSUB GET.UTILITY.RECORD IF INDEX(UTILITY.NAME,LAST.NAME,1) THEN NEW.LIST<-1> = UTILITY.ID REPEAT

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Wjhonson
[mailto:u2-users-boun...@listserver.u2ug.org] n Behalf Of Wjhonson ent: Thursday, July 12, 2012 4:16 PM o: u2-users@listserver.u2ug.org ubject: Re: [U2] trimming a list (a test of your ability) beg to differ. he runtime maintains a pointer to *your current attribute*, as I understand it. Not to *eac

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Eric Neu
Thought I'd have a go at something a bit different so I came up with a recursive routine (CHECK.LIST). I used a simple list of 5000 integers and filtered evens out as my test. The recursion basically splits the list in half until it's smallish, then processes CNT to 1 step -1. It didn't produce dra

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread David L. Wasylenko
r.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Thursday, July 12, 2012 4:16 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] trimming a list (a test of your ability) I beg to differ. The runtime maintains a pointer to *your current attribute*, as I unders

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread David L. Wasylenko
r.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Thursday, July 12, 2012 4:16 PM To: u2-users@listserver.u2ug.org Subject: Re: [U2] trimming a list (a test of your ability) I beg to differ. The runtime maintains a pointer to *your current attribute*, as I understand it.

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Tony Gravagno
> From: Lunt, Bruce > Could you show us a comparison of times using your methods? It'll take a while to do that, sorry. I'm just testing this functionality in the latest version which will be available for U2 in a month or so. But I will be publishing before/after performance data as part of the

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Wjhonson
o To: U2 Users List Sent: Thu, Jul 12, 2012 2:09 pm Subject: Re: [U2] trimming a list (a test of your ability) Nope; as to do with how systems handle system delimiters. ynamic arrays maintain pointers to attribute locations, but not the @VM ointers. he system already has buffering, memory manag

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Lunt, Bruce
] trimming a list (a test of your ability) Sort of OT: My NebulaXLite product builds XML files that can get into tens of megabytes. Concatenation with either method described below can cause this process to take 1/2 hour or longer. I developed a technique that reduces build time of these large blocks

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Wjhonson
al Message- From: Tony Gravagno <3xk547...@sneakemail.com> To: u2-users Sent: Thu, Jul 12, 2012 1:20 pm Subject: Re: [U2] trimming a list (a test of your ability) Sort of OT: y NebulaXLite product builds XML files that can get into tens of egabytes. Concatenation with either method describe

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread David L. Wasylenko
ers List Subject: Re: [U2] trimming a list (a test of your ability) You are probably thinking about the technique of pre-allocating the chunk of memory first, then manually overwriting sections instead of appending to the end. This saves on system calls to allocate new memory. I think there used

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Daniel McGrath
-Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David L. Wasylenko Sent: Thursday, July 12, 2012 12:58 PM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) I recall using attributes can be faster

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Tony Gravagno
Sort of OT: My NebulaXLite product builds XML files that can get into tens of megabytes. Concatenation with either method described below can cause this process to take 1/2 hour or longer. I developed a technique that reduces build time of these large blocks down to seconds, and no, this isn't a me

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread David L. Wasylenko
Of Daniel McGrath Sent: Thursday, July 12, 2012 1:50 PM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) Yes, exactly. If you starting breaking down what would be happening behind the scenes, you can see why X<-1>=I will be faster than X:= @AM:I will be faster

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Daniel McGrath
y (not necessarily in that order). -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David A. Green Sent: Thursday, July 12, 2012 10:25 AM To: 'U2 Users List' Subject: Re: [U2] trimming a list (a test of your ability)

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Daniel McGrath
7;t assume, test. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of David L. Wasylenko Sent: Thursday, July 12, 2012 9:59 AM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) *** slightly *** u

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Dave Laansma
, July 12, 2012 8:56 AM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) ROUNDS = 1 LOOP X = '' ; Y = '' START.TIME = TIME() FOR I = 1 TO ROUNDS X<-1> = I NEXT I END.TIME = TIME() CRT END.TIME-START.TIME : " vs

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread David A. Green
: Re: [U2] trimming a list (a test of your ability) ROUNDS = 1 LOOP X = '' ; Y = '' START.TIME = TIME() FOR I = 1 TO ROUNDS X<-1> = I NEXT I END.TIME = TIME() CRT END.TIME-START.TIME : " vs " : START.TIME = TIME() FOR I = 1 TO ROUN

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Wjhonson
did each routine twice as you can see, flipping the order to eliminate any possibility of caching having an effect. -Original Message- From: Dave Laansma To: U2 Users List Sent: Thu, Jul 12, 2012 7:59 am Subject: Re: [U2] trimming a list (a test of your ability) Is this technique si

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread David L. Wasylenko
From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Daniel McGrath Sent: Thursday, July 12, 2012 10:56 AM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ability) ROUNDS = 1 LOOP X = '' ; Y = '' START.TIME =

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Daniel McGrath
630.7392 . e:dmcgr...@rocketsoftware.com w: rocketsoftware.com/u2 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Thursday, July 12, 2012 7:30 AM To: U2 Users List Subject: Re: [U2] trimming a list (a test of y

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread u2ug
g.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' abou

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Dave Laansma
ubbardsupply.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] trimmi

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Dave Laansma
g Products, Services and Innovative Solutions" -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of George Gallen Sent: Thursday, July 12, 2012 9:30 AM To: U2 Users List Subject: Re: [U2] trimming a list (a test of your ab

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Rutherford, Marc
Use 'STEP -1' so as to work from the back to front. That would avoid the need to reset DISPLAY.LOOP and KEY.COUNT 1295 FOR DISPLAY.LOOP = KEY.COUNT TO 1 STEP -1 1296 UTILITY.ID = KEY.LIST<1,DISPLAY.LOOP> 1297 GOSUB GET.UTILITY.RECORD 1298 IF INDEX(UT

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Martin Braid
o: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 origina

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread George Gallen
ubject: 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.

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread George Gallen
That was my first thought, Change to KEY.COUNT TO 1 STEP -1 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Brian Leach Sent: Thursday, July 12, 2012 4:22 AM To: 'U2 Users List' Subject: Re: [U2] trimming

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Dave Laansma
oducts, 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 y

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Wjhonson
The general reason why I post code snippets like this, isn't really necessarily always to solve the issue I'm having, but often to see examples of how others solve similar issues. It's my belief that by sharing how we do things, we can all learn something new and interesting. We may use that,

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Brian Leach
Well, If you're deleting from a list you want to be iterating backwards. If you're on UniVerse you want to be using field not value level (for hint mechanism) or use revremove. It assumes LAST.NAME is not empty. Since I don't know your data I do know if using index will stuff it if is not a uniq

Re: [U2] trimming a list (a test of your ability)

2012-07-12 Thread Marco Manyevere
From: Kate Stanton To: U2 Users List 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(KE

Re: [U2] trimming a list (a test of your ability)

2012-07-11 Thread Rootman, Steven
Thanks Dennis, What happens if FM.ARRAY is empty? Would it not be better to: MORE = LEN(FM.ARRAY) LOOP UNTIL NOT(MORE) And then like you said. Thanks. dennis bartlett to force unique list (with REMOVE you don't have to know how many attributes are in FM.ARRAY) UNIQ.LIST = '' LOOP

Re: [U2] trimming a list (a test of your ability)

2012-07-11 Thread dennis bartlett
to strip _trailing_ field markers KEY.LIST := '~~' ; * some arb char set that wont be evident in the data LOOP CHANGE(KEY.LIST, @FM:'~~', '~~') UNTIL KEY.LIST[LEN(KEY.LIST)-2,1] NE @FM REPEAT CHANGE(KEY.LIST, '~~', "") to force unique list (with REMOV

Re: [U2] trimming a list (a test of your ability)

2012-07-11 Thread Kate Stanton
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 LOC