mikemccloskey Posted October 23, 2000 Posted October 23, 2000 Is there a way to tell a script - When you perform a find and the results are "no records found" to continue automatically or to otherwise continue to the next step?
dspires Posted October 23, 2000 Posted October 23, 2000 Use the Status(CurrentError) function, if it's equal to 401, do whatever.
Kurt Knippel Posted October 23, 2000 Posted October 23, 2000 quote: Originally posted by mikemccloskey: Is there a way to tell a script - When you perform a find and the results are "no records found" to continue automatically or to otherwise continue to the next step? You can also use Status ( CurrentFoundCount ) = 0 ------------------ =-=-=-=-=-=-=-=-=-=-=-=-= Kurt Knippel Consultant Database Resources mailto:[email protected] http://www.database-resources.com =-=-=-=-=-=-=-=-=-=-=-=-=
LiveOak Posted October 24, 2000 Posted October 24, 2000 Don't forget to SetErrorCapture (on) before you use tests in a script. Otherwise the dialog will still be displayed. -bd
Vaughan Posted October 25, 2000 Posted October 25, 2000 The "Set Error Capture=on" script step stops FMP from displaying the messages and is definately needed here. Just remember that this step disables FMP's internal error checking and *you* the developer are now responsible for trapping errors. For instance, if you peform a find then follow it with a delete all, what will FMP do with an empty found set? Use the Status[CurrentError] function in combination with If[] steps to provide solutions to these error situations. Note that the Status[CurrentError] function returns the value for the script step that just immediately ran. So if you perform a find, then change layout, then check the currenterror status, the error status will be for the change layout step not the find (so it will probably be zero). To work around this problem developers often create a global field and store the error status in the field. The example would now look like this perform find set field global=Status[CurrentError] change layout If[global=401] [This message has been edited by Vaughan (edited October 24, 2000).]
Recommended Posts
This topic is 8800 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now