dbTalk Databases Forums  

OpenQM Tip of the Week: The IN and NOT.IN Query Processor Selection Elements

comp.databases.pick comp.databases.pick


Discuss OpenQM Tip of the Week: The IN and NOT.IN Query Processor Selection Elements in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Gene Buckle
 
Posts: n/a

Default Re: OpenQM Tip of the Week: The IN and NOT.IN Query Processor Selection Elements - 10-21-2011 , 12:05 PM






To: Frank Winans
Frank wrote:
Quote:
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
dictate what language constructs you could use? I figure if they want THAT
much control, they're welcome to write the stupid program themselves.

g.


--
Proud owner of F-15C 80-0007
http://www.f15sim.com - The only one of its kind.
http://www.diy-cockpits.org/coll - Go Collimated or Go Home.
Some people collect things for a hobby. Geeks collect hobbies.

ScarletDME - The red hot Data Management Environment
A Multi-Value database for the masses, not the classes.
http://www.scarletdme.org - Get it _today_!

Political correctness is a doctrine, fostered by a delusional, illogical
minority, and rabidly promoted by an unscrupulous mainstream media, which
holds forth the proposition that it is entirely possible to pick up a turd
by the clean end.
--- Synchronet 3.15a-Win32 NewsLink 1.91
The Retro Archive - telnet://bbs.retroarchive.org

Reply With Quote
  #12  
Old   
wjhonson
 
Posts: n/a

Default Re: OpenQM Tip of the Week: The IN and NOT.IN Query ProcessorSelection Elements - 10-21-2011 , 05:29 PM






LOOP WHILE READNEXT ID DO THE.LIST := SPACE(1):ENQUOTE(ID) REPEAT


On Oct 20, 10:49*am, "Ed Sheehan" <NOedsS... (AT) xmission (DOT) com> wrote:
Quote:
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 -

Reply With Quote
  #13  
Old   
Excalibur21
 
Posts: n/a

Default Re: OpenQM Tip of the Week: The IN and NOT.IN Query ProcessorSelection Elements - 10-23-2011 , 06:03 PM



On Oct 21, 4:06*am, "Frank Winans" <fwin... (AT) sbcglobal (DOT) net> wrote:
Quote:
"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.
Holy Moses for a second or two I thought that I totally agreed with
TG :-)
Then I spotted it. One of the cardinal sins of programming in my
opinion.
The reliance on 0 and 1 giving true and false results without a proper
test for equality.
Ignoring the fact that Turing chose zero as true these tests are
totally unreliable across platforms.
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
My call would be
ID = ""
THE.LIST = ""
LOOP
READNEXT ID ELSE ID = @AM
WHILE ID NE @AM DO
THE.LIST := \ "\:ID:\"\
REPEAT
As for truncating the code. I have nothing against careful use of
GOTO or even RETURN TO but putting multiple statements on a line saves
nothing and makes it harder to read or debug.
Peter McMurray

Reply With Quote
  #14  
Old   
Kevin Powick
 
Posts: n/a

Default Re: OpenQM Tip of the Week: The IN and NOT.IN Query Processor Selection Elements - 10-23-2011 , 08:12 PM



On 2011-10-23 19:03:46 -0400, Excalibur21 <pgmcmurray (AT) gmail (DOT) com> said:

Quote:
ID = ""
THE.LIST = ""
LOOP
READNEXT ID ELSE ID = @AM
WHILE ID NE @AM DO
THE.LIST := \ "\:ID:\"\
REPEAT
I'm sure this intent of this thread wasn't code critique, but I'm
taking a little break. So....

I prefer positive over negative conditionals. So I always try to avoid
testing that something is NE to a value. 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.

Personally, I would minimize variables, conditionals, and indentation
by just exiting the loop

THE.LIST = ''
LOOP
READNEXT ID ELSE EXIT
THE.LIST := \ "\:ID:\"\
REPEAT

--
Kevin Powick

Reply With Quote
  #15  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: OpenQM Tip of the Week: The IN and NOT.IN Query Processor Selection Elements - 10-24-2011 , 05:28 PM



Excalibur21 wrote:
Quote:
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
That code is found in an article dedicated to a feature of D3.
It works on the platform for which it was written.

*sigh*

I often wonder where this market would be if people discussed real
features, modern development tools and techniques, and market concerns
for new sales, with the same fervor as some of these trivial
syntactical nuances.

T

Reply With Quote
  #16  
Old   
chandru murthi
 
Posts: n/a

Default Re: OpenQM Tip of the Week: The IN and NOT.IN Query ProcessorSelection Elements - 11-12-2011 , 11:14 AM



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!

Reply With Quote
  #17  
Old   
chandru murthi
 
Posts: n/a

Default Re: OpenQM Tip of the Week: The IN and NOT.IN Query ProcessorSelection Elements - 11-12-2011 , 11:16 AM



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!

Reply With Quote
  #18  
Old   
sdavmor
 
Posts: n/a

Default Re: OpenQM Tip of the Week: The IN and NOT.IN Query Processor SelectionElements - 11-12-2011 , 12:53 PM



On 11/12/2011 09:16 AM, chandru murthi wrote:
Quote:
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!
It's always good to see you weigh in Chandru! Thanks for posting.
--
Cheers, SDM -- a 21st Century Schizoid Man
Systems Theory project website: http://systemstheory.net
find us on MySpace, GarageBand, Reverb Nation, Last FM, CDBaby
free MP3s of Systems Theory, Mike Dickson & Greg Amov music at
http://mikedickson.org.uk

Reply With Quote
  #19  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: OpenQM Tip of the Week: The IN and NOT.IN Query Processor Selection Elements - 11-12-2011 , 01:48 PM



+1

sdavmor wrote:
>It's always good to see you weigh in Chandru! Thanks for posting.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.