![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
"Joe"wrote iJah wrote large dynamic arrays - in Advanced Pick. This is being done all over with the usual N=DCOUNT(REC,CHAR(254) FOR I=1 TO N LINE = REC<I NEXT I obviously the deeper you get into the array the slower the crawl. any clues? If you've already got the array in memory, can't you simply SELECT the array, then do a LOOP WHILE READNEXT thing? SELECT REC LOOP WHILE READNEXT LINE DO whatever... REPEAT The syntax may be different for your platform, but you get the idea... Regards, Joe * Close, but AP READNEXT wants an ELSE clause. SELECT REC LINE='dummy' LOOP WHILE LINE # "sentryvalue" READNEXT LINE ELSE LINE = "sentryvalue" DO whatever... REPEAT |
|
**** And just because it is so easy to code, I'd try Frosty's & **** Marvin Fisher's idea of a dimensioned array, for a 'plan B' worksize = DCOUNT(rec, @AM) DIM work(worksize) work = MAT rec FOR J=1 to worksize line = work(J) NEXT J * or code it as MATPARSE work FROM rec using @AM ***** Dale Benedict advocated QSELECT, but I just cannot ***** see the charm of REC to a disk item just so QSELECT can ***** read it back in. Just SELECT REC avoids a read/write pair. |
#12
| |||
| |||
|
|
Write the dynamic array to a workfile, then MATREAD it back in (as a dimensioned array.) There might be a more direct way to do this in BASIC, like MATPARSE or similar? (Been a long time since I've used A/P.) |
#13
| |||
| |||
|
|
I'm looking for some way to improve performance of data extraction from large dynamic arrays - specifically in Advanced Pick. The mechanics of what I'm working with are already deeply ingrained in the application software and I'm not going to re-invent the wheel, but the sitch is that reports get written to a single record in one big/fat attribute mark delimited array, then each line (attribute) has to be extracted and parsed and handled for a variety of reasons. This is being done all over with the usual N=DCOUNT(REC,CHAR(254) FOR I=1 TO N LINE = REC<I NEXT I obviously the deeper you get into the array the slower the crawl. in Universe i'd just use the 'REMOVE' statement and it would fly. i've tried advanced picks flavor of remove - i think the syntax is like 'remove element at position from array setting delimiter.code' but i just don't seem to get much if any performance boost using that method. any clues for how to turbo charge this kind of extraction? |
#14
| |||
| |||
|
|
thanks everyone for the most excellent replies! i think the select myarray to myslist loop readnext line from mylist else exit ... repeat idea is really gonna do the trick. |
|
i had no idea you could do an internal 'select' on a variable containing an array. i thought you could only do internal selects on file handles - variables files had been opened to. |
![]() |
| Thread Tools | |
| Display Modes | |
| |