Strange....

Terry A. Pickering pickering@myself.com
Wed, 18 Mar 1998 15:37:01


I have a very simple screen used to enter values into a code table. Here is
what the file layout look like from QSHOW:

  Record:             GLS-CODE-TBL
    of File:            GLS-CODE-TBL
    Organization:       INDEXED
    Type:               RMS
    Open:               GLS_DAT:901
    Record Format:      Fixed
    Supersede:          No

    Record Size:        76 Bytes

-- Record Contents --
    Item                                 Type            Size  Occ  Offset
    SELECT-CODE                          CHARACTER          2            0
    CODE-KEY                             CHARACTER          4            2
    CODE-LONG-NAME                       CHARACTER         30            6
    CODE-VALUE                           CHARACTER         40           36

-- Index Contents --

 ** SELECT-CODE-KEY is a 6 byte   UNIQUE PRIMARY ASCENDING  index **

    Segment                              Type            Size
    SELECT-CODE                          CHARACTER          2
    CODE-KEY                             CHARACTER          4


Here is the original QUICK statements:




SCREEN GLS_EXE:GLSK901
FILE GLS-CODE-TBL
  ACCESS VIAINDEX SELECT-CODE-KEY REQUEST SELECT-CODE
  ACCESS SEQUENTIAL

FIELD SELECT-CODE OF GLS-CODE-TBL REQUIRED
FIELD CODE-KEY OF GLS-CODE-TBL ID SAME REQUIRED LOOKUP NOTON &
      GLS-CODE-TBL VIAINDEX SELECT-CODE-KEY &
           USING SELECT-CODE , CODE-KEY 
           
FIELD CODE-LONG-NAME OF GLS-CODE-TBL
FIELD CODE-VALUE OF GLS-CODE-TBL

BUILD



The problem is when you enter in the first segment of the key (SELECT-CODE)
it does NOT find the first record with a value beginning with what was
entered. Instead, it was retrieving as if it was a sequential read.

So I was curious as to why, so I added a BUILD DETAIL LIST and looked at
the PATH and FIND procedures that QDESIGN was generating. Here is what they
look like:

PROCEDURE PATH
  BEGIN
    REQUEST SELECT-CODE OF GLS-CODE-TBL
    IF PROMPTOK
      THEN LET PATH = 1
    IF PATH = 0
      THEN BEGIN
        LET PATH = 2
        END
    END

PROCEDURE FIND
  BEGIN
    IF PATH = 1
      THEN GET GLS-CODE-TBL VIAINDEX SELECT-CODE-KEY
    IF PATH = 2
      THEN GET GLS-CODE-TBL SEQUENTIAL
    END


Notice the GET statement that was generated in the FIND procedure. I
changed it slightly to read as what I would have expected PowerHouse to
have generated. Once I did this, it worked fine. Here is the new GET
statement:

      THEN GET GLS-CODE-TBL VIAINDEX SELECT-CODE-KEY using select-code

My question is: Shouldn't QDESIGN have generated the GET statement
correctly based upon REQUEST verb on the ACCESS statement? If not, it seems
strange for such a simple screen where you have to resort to modifing the
FIND procedure.
Should I submit this as a "bug"?

Running on Alpha 7.10F3


Terry Pickering				CompuGroup, Inc.
pickering@myself.com				Portland, Oregon USA
www.teleport.com/~compugrp			Cessna 172 & Lancair ES

                           __!__          

               _______(*)_______    

                          !   !   !        


= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.