dbTalk Databases Forums  

No error massage on emty search?

comp.databases.filemaker comp.databases.filemaker


Discuss No error massage on emty search? in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Aladino
 
Posts: n/a

Default No error massage on emty search? - 08-11-2005 , 03:31 PM






I've a script that performs a record search (I copy/paste the value to
search), but if there are no records matching the request, I wont that
script halts to display that there are no records... I simply want it
continue. How can I do?

Reply With Quote
  #2  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: No error massage on emty search? - 08-11-2005 , 03:55 PM






Say gt1 is a global.
Your script will then look like :

Enter Browse mode
Set field(gt1, your search criterium)
Set error capture (on)
Enter Find mode
Set field(your field, gt1)
Perform Find
If(Status ( CurrentError ) = 401
Set error capture (off)
Show message("There are no records found")
Find all
Exit (or Halt) Script
End If
Set error capture (off)
....do stuff if there are records found...

Remi-Noel



"Aladino" <borgobello-NO (AT) SPAM-adriacom (DOT) it> a écrit dans le message de
news: 1h15ic6.vyuqkw1s0o1usN%borgobello-NO (AT) SPAM-adriacom (DOT) it...
Quote:
I've a script that performs a record search (I copy/paste the value to
search), but if there are no records matching the request, I wont that
script halts to display that there are no records... I simply want it
continue. How can I do?



Reply With Quote
  #3  
Old   
Helpful Harry
 
Posts: n/a

Default Re: No error massage on emty search? - 08-11-2005 , 03:56 PM



In article <1h15ic6.vyuqkw1s0o1usN%borgobello-NO (AT) SPAM-adriacom (DOT) it>,
borgobello-NO (AT) SPAM-adriacom (DOT) it (Aladino) wrote:

Quote:
I've a script that performs a record search (I copy/paste the value to
search), but if there are no records matching the request, I wont that
script halts to display that there are no records... I simply want it
continue. How can I do?
Unless you're testing for a Find error or the user is cancelling the
script, the script will continue after the error message has been
dismissed by the user.

To get rid of the error message you can use the Set Error Capture
command to intercept error messages from the Perform Find command.
eg.
Set Error Capture [On]
Perform Find []
{rest of script}

This will perform the rest of the script no matter what happens and
won't display ANY error messages for the Perform Find command.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #4  
Old   
Aladino
 
Posts: n/a

Default Re: No error massage on emty search? - 08-21-2005 , 09:18 AM



Remi-Noel Menegaux <rnmenegaux (AT) free (DOT) fr> wrote:


Quote:
Set field(your field, gt1)
Thanks, Herry's tip was enough, but thank to you I've learned a new
thing: I didn't know I can set fields in find mode. That can be useful
for another time.


Reply With Quote
  #5  
Old   
Aladino
 
Posts: n/a

Default Re: No error massage on emty search? - 08-21-2005 , 09:18 AM




Quote:
To get rid of the error message you can use the Set Error Capture
command to intercept error messages from the Perform Find command.
eg.
Set Error Capture [On]
Perform Find []
{rest of script}

Thanks, I was using "Set Error Capture [Off]" thinking this should
disappare error massages.
Now all it's clear.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.