-
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()
-
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()
-
Re: Found()
Sorry, that one line should read:
IF .NOT. lFoundIt &&... -ds-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks