Help with SELECT in QUICK (ver 8.49.D1) on HP3000

Pickering, John (NORBORD) John.Pickering at norbord.com
Thu Sep 13 15:26:08 CDT 2007


Peter

Please read that select statement again!

>Select if t-saved-value = key of
master-file[1:size(tru(t-saved-value))]

If the user enters 'ABC' the my method will get all records that start
with 'ABC'.

Regards,
JWP

-----Original Message-----
From: powerh-l-bounces+john.pickering=norbord.com at lists.sowder.com
[mailto:powerh-l-bounces+john.pickering=norbord.com at lists.sowder.com] On
Behalf Of Peter Bateman
Sent: Thursday, September 13, 2007 4:01 PM
To: powerh-l at lists.sowder.com
Subject: RE: Help with SELECT in QUICK (ver 8.49.D1) on HP3000

Hi Chuck:

  I am presuming that the client enters the whole key or first part of
the 
key.

  Image now has b-tree indexed keys. If you have  indexed on the key of
the 
master.

  temporary t-key char * <n> reset at startup
  File my-detail primary
  Access via Key request key using (tru (t-key) + '@')

  Procedure input key
  begin
     if FINDMODE
       then let t_key = fieldtext
  end
This should make the "Select" go faster.
Some consideration should be given to trailing blanks.
Suppose 'ABC ' is on file and also 'ABCD'. and the client entered 'ABC'
John's method would give you just the records with 'ABC ' whereas my
method woud give you both. You could combine both method if that
is desired.

Regards,
Peter Bateman

>From: "Pickering, John (NORBORD)" <John.Pickering at norbord.com>
>To: "Lowe, Chuck J" <Chuck.J.Lowe at questdiagnostics.com>,        
><powerh-l at lists.sowder.com>
>Subject: RE: Help with SELECT in QUICK (ver 8.49.D1) on HP3000
>Date: Thu, 13 Sep 2007 11:14:28 -0400
>
>You could do this with custom Path and Find procedures. But you're
>opening yourself up for a lot of work because the lazy users will like
>how it works and want the same function everywhere!
>
>Request the key in the path procedure. Check if the master record
exists
>by doing a "get file optional" right there in the path procedure. If
the
>record exists (accessok) then "let path = 1" otherwise "let path = 2".
>You will also need to save the value that the user entered in a temp
>with a "reset at startup"
>
>In the find procedure you should test the value of path and either get
>the master via the key using the value that was entered or get the
>master file sequentially. This is pretty much the default find
procedure
>but if I write a path procedure then I always write the find procedure.
>There should be a select clause on the file statement to select records
>for which part of the key matches the value the user entered. Something
>like:
>   Select if t-saved-value = key of
>master-file[1:size(tru(t-saved-value))
>
>It will take you a couple of tries to get it working! Have fun :-)
>
>Regards,
>JWP
>
>-----Original Message-----
>From: powerh-l-bounces+john.pickering=norbord.com at lists.sowder.com
>[mailto:powerh-l-bounces+john.pickering=norbord.com at lists.sowder.com]
On
>Behalf Of Lowe, Chuck J
>Sent: Thursday, September 13, 2007 10:34 AM
>To: powerh-l at lists.sowder.com
>Subject: Help with SELECT in QUICK (ver 8.49.D1) on HP3000
>
>I have a quick screen that access a Manual Master in Turbo-Image. What
I
>need to do is if the user can't find a record (in Find mode) it will do
>a Select without the user having to enter S in the mode and without the
>user having to put a '@' after the value.
>
>Thanks in Advance!
>
>Chuck Lowe
>
>--



More information about the powerh-l mailing list