![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Martin, that's great stuff. Thanks for the tip. For anyone not using QM, I documented similar functionality a few years ago for D3: nospamNebula-RnD.com/blog/tech/mv/2008/03/d3shell1.html Martin's tip is as thread Subject indicates; |
#4
| |||
| |||
|
|
Martin's tip is as thread Subject indicates; Tony G's blog is about shell vars. |
#5
| |||
| |||
|
|
"Tony Gravagno" wrote Martin, that's great stuff. Thanks for the tip. For anyone not using QM, I documented similar functionality a few years ago for D3: nospamNebula-RnD.com/blog/tech/mv/2008/03/d3shell1.html Martin's tip is as thread Subject indicates; Tony G's blog is about shell vars. About that blog; your code is good solid Structured Programming, but I'd probably collapse this code DONE = 0 LOOP READNEXT ID ELSE DONE=1 UNTIL DONE DO THE.LIST := \ "\:ID:\"\ REPEAT to just SELF: * READNEXT ID THEN THE.LIST := \ "\:ID:\"\ ; GO SELF Unless the client specifically forbade using GO or GOTO. |
#6
| |||
| |||
|
|
Martin, that's great stuff. Thanks for the tip. For anyone not using QM, I documented similar functionality a few years ago for D3: |
#7
| |||
| |||
|
|
Hi all, Thursday once more... The latest Tip of the Week article can be found at http://www.openqm.com/tow.htm. Martin Phillips, Ladybridge Systems |
#8
| |||
| |||
|
|
Now, that is quite cool ... although I guess I'd have done something like: QSELECT somefile item LIST anotherfile WITH selection-criteria output And the NOT.IN would be achieved with a combination of SELECT and NSELECT. |
#9
| |||
| |||
|
|
LOOP WHILE READNEXT ID DO THE.LIST := \ "\:ID:\"\ REPEAT This works in Universe. Try. Buy. |
#10
| |||
| |||
|
|
On Oct 20, 6:49 pm, "Ed Sheehan"<NOedsS... (AT) xmission (DOT) com> wrote: LOOP WHILE READNEXT ID DO THE.LIST := \ "\:ID:\"\ REPEAT This works in Universe. Try. Buy. And this same syntax was recently added to QM to ease a migration. However..... Think carefully about this loop. You start with an empty string and then concatenate each id, one by one. I am fairly certain that UV will copy the string for each concatenation because it uses contiguous strings. QM optimises this by use of "chunked strings" that gain in this sort of operation but can lose in others. For this particular statement, we will reduce, but not eliminate, the copying. We can, however, do much better READLIST THE.LIST THEN THE.LIST = \"\ : CHANGE(THE.LIST, @FM, \ "\:ID:\"\) : \"\ The rather messy conversion of the field mark delimited select list to a space separated list of quoted ids can probably be improved but this works fine. Just for fun, I tried both methods on UV and QM with a select list containing 162182 items that I had conveniently available. Like all test results, these should be verified before trusting them completely... LOOP method QM 37.299 seconds UV 61.803 seconds READLIST method QM 0.281 secods UV 40.770 seconds I expected this test to be super fast on QM because of how READLIST works. The READLIST figure for UV surprised me as the UV internals course materials recommend this approach on the basis that is simply changes a memory pointer. Out of the 40.770 seconds all but 0.312 seconds are used by the READLIST. Sadly, there is no internals data available for Unidata. The same test produces an astonishingly fast execution of the LOOP method that ought to be slow but a result similar to that of UV for the READLIST method. I do not quote figures because the Unidata test was on a different system. Martin Phillips, Ladybridge Systems. |
![]() |
| Thread Tools | |
| Display Modes | |
| |