How to locate a (pattern of) a value in a LIST?

How to locate a (pattern of) a value in a LIST?

Post by Willem Wigge » Tue, 13 Feb 1996 04:00:00



Problem: in a list, one cannot type the word to be searched for, but only the
first character.
So I created an undefined field and tried to attach a UIObject or TCursor to
the list which is shown below that undefined Field. But the list doesn't seem
to be searched. The list is based on one field of a table, the table (and
therefore the listed field) is variable.

At least the screen doesn't update to the searched item like in a lookup table:

 >>> _First list item
a >>> Abbey
ar >>> Array
art >>> Art
arti >>> Artificial

Does anyone know how to solve the problem?
Please send E mail to (the reply of Trumpet apparently doesn't function here):


Thanks a lot, Willem

 
 
 

How to locate a (pattern of) a value in a LIST?

Post by Kuo-Sheng (Kas » Wed, 14 Feb 1996 04:00:00


: Problem: in a list, one cannot type the word to be searched for, but
: only the : first character. : So I created an undefined field and tried to
: attach a UIObject or TCursor to : the list which is shown below that
: undefined Field. But the list doesn't seem : to be searched. The list is
: based on one field of a table, the table (and : therefore the listed
: field) is variable.

If this is 5.0, intercept the keyphysical and move the record yourself by
keeping track of the keys entered so far and move up or down the list via
OPAL.

--
=========================================================================
Kasey K. S. Chang (a guy)             | Paradox for Windows Programmer

URL> http://userwww.sfsu.edu/~kschang | X-COM Guru   General PC expert
--------------------------------------+----------------------------------
Editor of XCOM and XCOM2 UN-official Strategy Guide -- FREE!  (See URL)

 
 
 

How to locate a (pattern of) a value in a LIST?

Post by Paul Schop » Fri, 16 Feb 1996 04:00:00



> Problem: in a list, one cannot type the word to be searched for, but only the
> first character.
> So I created an undefined field and tried to attach a UIObject or TCursor to
> the list which is shown below that undefined Field. But the list doesn't seem
> to be searched. The list is based on one field of a table, the table (and
> therefore the listed field) is variable.

> At least the screen doesn't update to the searched item like in a lookup table:

>  >>> _First list item
> a >>> Abbey
> ar >>> Array
> art >>> Art
> arti >>> Artificial

> Does anyone know how to solve the problem?
> Please send E mail to (the reply of Trumpet apparently doesn't function here):


> Thanks a lot, Willem

I use the following code for drop-down edit boxes where I
want to start typing in characters and finding the matches
as I go:

  i.e.  Typing  A then B
        finds   Aardvark
        then    Abalone

        out of a list box that contains

              Aardvark
              Aaghaaah
              Abalone
              Buck

        Typing  A then B then C
        does not find anything, but the field now contains "ABC"

IMPORTANT:: the ILIST object is the list object attached to the
            drop-down edit box

-------------------------------------------------------------------

method KeyChar(var eventInfo KeyEvent )
var
 sofar, newListValue string
 n,i                 smallint
endvar

Dodefault  

sofar = self.value
newListValue =  ILIST.list.value  { This is what Dodefault does for you

Quote:}

{
   If what we have typed was found in the list, an advMatch
   will work.  If you want Case sensitivity or not
   use the appropriate call to IgnoreCaseInStringCompares()
   in the form::open method.  The "^" is necessary so we search
   for matches which start with what we have typed
 }

if not advMatch( newListValue , "^"+sofar )  
 then
   return      { What we have selected did not match.  Stop trying to
                 process stuff for the user, and just take the
keystrokes }
endif

 DelayScreenUpdates(yes)         ; Not necessary, but it helps
 n=sofar.size()    

 self.value = newListValue     { Set the (uncommitted) field value
                                 to the value from the list
                                 If the user now hits <RETURN>, then
                                 the listValue will be passed to
                                 ChangeValue() }

  {
     We now prepare for the next keyChar event.  Select all the
     characters in newListValue that we have NOT typed.  On the
     next keystroke, these will be replaced with the character
     typed
  }                                  

 active.action( EditEnterFieldView )
 active.action( MoveBeginLine )
 if n>0 then
   for i from 1 to n
    active.action( MoveRight )
   endfor
 endif
 active.action( SelectEndLine )  ; The stuff you didn't type is
higlighted
                                 ; and will be replaced if you type
another
                                 ; character.
 DelayScreenUpdates( no )

endmethod

------------------------------------------------------------------------
  In the example above, When we press A,  Aardvark is found in the list,
  and the characters "ardvark" are left selected.

  When we press B, these characters are replaced with B, yielding
     "AB"

    The advMatch finds Abalone, and leaves "alone" selected.

  If the user hits return now, Abalone is passed to ChangeValue

  If we press "C", then "alone" is replaced with C and we
  get   "AbC" and we exit without further processing -- the input
  pointer is after the C, so any further typing adds to the
  end of ABC and returns too.

  I use a special ChangeValue() method to see if the
 eventInfo.newValue() is in the list, and if not, ask whether to
 do a quick Add.  You could also modify the above to prevent
 the user from typing in valuse that are not in the list at all
 (i.e. change what happens when the AdvMatch fails )

--

Coupled Climate Dynamics Group/971
http://ccdg.gsfc.nasa.gov/index.html
NASA Goddard Space Flight Center              
Greenbelt, MD 20771

 
 
 

1. Pattern Count and value lists

I use the Pattern Count feature to define value lists in a products
database.  I use it under the field called types.  I have many different
types of products for flooring such as carpet, hardwood, ceramic, vinyl,
marble, etc..

How do I have a field in an estimating database choose a value list based on
the selected type?  I would like to have them choose the type of flooring
they are looking for and then in the description, I only want the product
names to appear that have carpet selected in the product type.  Basically, I
want different value lists to appear in one field based on the type of
flooring they select.

Example:  If they select carpet in the type, the next field would only have
all the carpet names but if they select ceramic, all the ceramic names would
appear.  Any help would be appreciated.

Brian

2. owa_cookie - reading values, session variables.

3. Locate value in List Object??

4. rmijdbc error

5. Help with Locate pattern pdox ver 5

6. FP Mac from a Novell server?

7. Please Help- Locate Pattern

8. Error: 17826

9. HELP (Syntax) Locate Pattern

10. Paradox LOCATE INDEXORDER, patterns and vallist

11. Pattern Matching Date Values with LIKE

12. parsing a comma delimited list to use as a value list in an insert

13. Value list and field list