DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: Found()

  1. #1
    Neil Whittington Guest

    Found()


    Hi everyone..

    In the below code i cannot seem to get a messagebox to tell the user when
    a searched for item has not been found.
    Everytime i put in the messagebox, it appears after each individual table
    has been searched through. I only want it to appear if it has searched through
    "ALL" the tables and no record has been found??
    An enthusiastic but not so efficient vfp6 ")programer("




    Local lcfield, mdir,lcbase,lncerti

    lncerti = alltrim(ThisForm.txtSearch.value)

    Select 1
    Set path to c:\mha
    Use mhabase
    Set filter to active = .t.
    Go top
    Do while not eof()
    Set order to basedir
    lcfield = basedir
    lcbase = basename
    mdir = "c:\mha\" + alltrim(lcfield)
    Set path to &mdir

    Select 2
    Set exclusive on
    Use &mdir\certific.dbf
    Index on cert tag cert
    Seek m.lncerti
    If found()
    Wait window("certificate found in ");
    + lcbase + lednam + lcfield + cert
    Endif


    && ** if i have the message box here it appears
    && ** after each individual table has been searched thru
    && ** i only want it to show when all the tables have
    && ** been searched thru


    Use
    Select 1
    Skip
    Enddo
    Use
    Thisform.txtSearch.refresh()

  2. #2
    Dave S Guest

    Re: Found()


    Try it this way. I noted the changes with "&&... -ds-":

    Local lcfield, mdir,lcbase,lncerti

    lncerti = alltrim(ThisForm.txtSearch.value)

    Select 1
    Set path to c:\mha
    Use mhabase
    Set filter to active = .t.
    Go top

    STORE .F. TO lFoundIt &&... -ds-

    Do while not eof()
    Set order to basedir
    lcfield = basedir
    lcbase = basename
    mdir = "c:\mha\" + alltrim(lcfield)
    Set path to &mdir

    Select 2
    Set exclusive on
    Use &mdir\certific.dbf
    Index on cert tag cert
    Seek m.lncerti
    If found()
    lFoundIt = .T. &&... -ds-
    Endif


    && ** if i have the message box here it appears
    && ** after each individual table has been searched thru
    && ** i only want it to show when all the tables have
    && ** been searched thru


    Use
    Select 1
    Skip
    Enddo
    Use
    IF lFoundIt &&... -ds-
    Wait window("certificate found in ");
    + lcbase + lednam + lcfield + cert &&... -ds-
    ENDIF &&... -ds-

    Thisform.txtSearch.refresh()



  3. #3
    Dave S Guest

    Re: Found()


    Sorry, that one line should read:

    IF .NOT. lFoundIt &&... -ds-

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links