Search for Unknown character/numeric


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Search for Unknown character/numeric

  1. #1
    tina Guest

    Search for Unknown character/numeric


    I have a textbox in which I use to search for information.
    However, I want to be able to search for a partial letter or numberic
    which then pull back everything that related to that partial letter or numeric.

    I try to use the function LIKE() but it not working pretty well. Is there
    a better way to do this?

    Thanks

    Tina

  2. #2
    Nancy Folsom Guest

    Re: Search for Unknown character/numeric

    If you tell what you are trying with LIKE(), and give us an example of what
    you are searching for and what is not being found that you think should be
    found, then we can better help you.

    --

    Nancy

    Please post replies to the newsgroup
    so everybody benefits from the
    discussion.

    Best viewed with a non-proportional font.

    "tina" <vo76@yahoo.com> wrote in message news:39cf767d$1@news.devx.com...
    >
    > I have a textbox in which I use to search for information.
    > However, I want to be able to search for a partial letter or numberic
    > which then pull back everything that related to that partial letter or

    numeric.
    >
    > I try to use the function LIKE() but it not working pretty well. Is there
    > a better way to do this?
    >
    > Thanks
    >
    > Tina




  3. #3
    David Frankenbach Guest

    Re: Search for Unknown character/numeric

    Tina,

    You can use the $ operator to see if a string exists inside another

    ? "def" $ "abcdefghij"
    --
    df - (Microsoft FoxPro MVP) http://www.geocities.com/df_FoxPro/

    "tina" <vo76@yahoo.com> wrote in message news:39cf767d$1@news.devx.com...
    >
    > I have a textbox in which I use to search for information.
    > However, I want to be able to search for a partial letter or numberic
    > which then pull back everything that related to that partial letter or

    numeric.
    >
    > I try to use the function LIKE() but it not working pretty well. Is there
    > a better way to do this?





  4. #4
    Ellick Guest

    Re: Search for Unknown character/numeric


    Hi,
    I have a sample code below which might help you a bit.

    A TEXT BOX (thisform.text13 below)in a form captures a character or a string
    for the partial search. The user presses a BUTTON to excute the following
    codes.

    If it is a successful search, it return all matched records and display them
    on a pop up browse window. If the user pressed ESC, nothing is perform,
    the operation return to the form. If the user pressed ENTER or Right Click
    on the selected record, the data of that record will display on the calling
    from.

    Hope this will give you some helps. ^.^

    Ellick
    *----------------------------------------------------
    searchLen = LEN(ALLTRIMthisform.text13.value))
    searchNme = ' '+ALLTRIM(thisform.text13.value)+' '

    DEFINE WINDOW partialList FROM 8,10 TO 35,120;
    SYSTEM NOGROW FLOAT NOMINIM NOZOOM CLOSE;
    FONT 'ARIAL',8

    WAIT WINDOW AT 22,35 NOWAIT ' One Moment Please, While Loading
    Search Target Into Browse Window....... '

    SELECT accno, coname1, phone, contact;
    FROM local;
    WHERE AT(searchNme,local.coname1) > 0;
    ORDER BY local.coname1;
    INTO CURSOR FullNameBrow

    ON KEY LABEL ENTER KEYBOARD CHR(23)
    ON KEY LABEL RIGHTMOUSE KEYBOARD CHR(23)

    IF _TALLY > 0
    WAIT WINDOW AT 18,50 NOWAIT ' Process Completed '
    BROW NOAPPEND NOEDIT NODELETE NOMENU;
    WINDOW partialList TITLE 'Found Record <Ctrl+W> Select <Esc>
    Quit';
    FIELD FullNameBrow.accno:R:H='A/C',;
    FullNameBrow.coname1:R:H='Co. Name',;
    FullNameBrow.phone:R:H='Phone No.',;
    FullNameBrow.contact:R:H='Contact Person'
    ELSE
    WAIT CLEAR
    =MESSAGEBOX( searchNme+' Not Found !',0+16+0, 'Search Error')
    thisform.text13.setfocus
    ENDIF
    *----------------------------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center