Newbies LostInSpace Posted February 17, 2003 Newbies Posted February 17, 2003 Have a filemaker file called startup that has a few buttons that run scripts and all they do is open different hosted files. i.e. Button A from startup opens hosted file A. Button B opens hosted file B. etc. Now when this script is run and the hosted file isn
Vaughan Posted February 17, 2003 Posted February 17, 2003 What's happening is FMP is handling the errors for you -- when the Open step fails it prompts the user to fix the problem by locating the file again and updating itself to remember the new location. Of course the file isn't there so FMP cannot update the new location but it forgets the old one since it's dead anyway. To solve the problem you have to do two things: tell FMP not to handle the error; and handle the error yourself. The step "Set Error Capture [on]" tells FMP that you want to handle the error. The Status(CurrentError) function lets you work out whether an error has occurred, and you use the function in conjunction with IF conditonals. The script could look something like this: Set Error Capture [on] Open [file1] If[status(CurrentError) <> 0] Beep Show Message [Error opening file.] End If Open [file2] If[status(CurrentError) <> 0] Beep Show Message [Error opening file.] End If Open [file3] If[status(CurrentError) <> 0] Beep Show Message [Error opening file.] End If Look up the Status(CurrentError) function in FMP Help to get a list of the error codes. Print them out, they come in handy.
Newbies LostInSpace Posted February 18, 2003 Author Newbies Posted February 18, 2003 That did the trick. Thanks.
Recommended Posts
This topic is 7953 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