October 23, 200025 yr 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?
October 23, 200025 yr 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 =-=-=-=-=-=-=-=-=-=-=-=-=
October 24, 200025 yr Don't forget to SetErrorCapture (on) before you use tests in a script. Otherwise the dialog will still be displayed. -bd
October 25, 200025 yr 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).]
Create an account or sign in to comment