![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
From Newsgroup: comp.databases.pick 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. Erm, not to be rude or anything, but why on earth would you let a client |

#12
| |||
| |||
|
|
LOOP WHILE READNEXT ID DO THE.LIST := \ "\:ID:\"\ REPEAT This works in Universe. Try. Buy. Ed "Frank Winans" <fwin... (AT) sbcglobal (DOT) net> wrote in message news:VtudnbuHyMOx2j3TnZ2dnUVZ_sqdnZ2d (AT) posted (DOT) internetamerica... "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.- Hide quoted text - - Show quoted text - |
#13
| |||
| |||
|
|
"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. |
#14
| |||
| |||
|
|
ID = "" THE.LIST = "" LOOP READNEXT ID ELSE ID = @AM WHILE ID NE @AM DO THE.LIST := \ "\:ID:\"\ REPEAT |
#15
| |||
| |||
|
|
D3 regards any non zero as true and one can waste a lot of time looking for strange results when.code is moved to another platform |
#16
| |||
| |||
|
#17
| |||
| |||
|
#18
| |||
| |||
|
|
Rarely do I come across a thread with which I disagree on so many counts! Firstly, Frank W suggests using a GOTO/label, and why? Who uses GOTO nowadays? How about this 3 liner if Tony's code offends (which works cross platform): LOOP READNEXT ID THEN .... ELSE EXIT REPEAT or if your compiler supports it: LOOP READNEXT ID THEN .... ELSE EXIT ; REPEAT Second, that QM chose to implement an unnecessary READLIST syntax shows that desginers don't use prior experience; Ultimate, Sequoia (maybe D3) et al allow(ed) you to just use a Select variable as a dynamic array (why they are internally different is the mystery), uv does not. So the entire loop is unnecessary SELECT TO THE.LIST ; * not needed of course if you Selected or Get- List-ed to THE.LIST in the first place! IF THE.LIST # '' THEN THE.LIST = '"':CONVERT(@AM,\""\,THE.LIST):'"" and Martin: Convert's twice as fast as CHANGE, at least on uv. Third:>Ignoring the fact that Turing chose zero as true these test... Yes, and maybe we should use the Babbage Engine for our computing needs, I hear they're building a wooden one in England.... if there is any Pick-y platform that does not treat 0 as false and 1 as true, please cite (and I'll avoid it); it's built into the language. Even javascript, that much-maligned language, treats non-zero as true and 0, false,null and undefined as false. Kevin>And I certainly wouldn't be using a system delimiter as the value for my test. I admit it's perfectly valid, but seems a little weird to me. It's actually the *best* value to use, since (in this particular case using @AM), there's *no possibility* of a conflict and that's the point. However, I say that in a loop-whatever-repeat case, setting a variable at all instead of Exiting seems a little weird to me! |
#19
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |