Jump to content

This topic is 7316 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi All,

Is there a way to trap the error that is produced when a related file

is not found as you open the "parent" file??

In an open script, i am trying to test to see if a related file is present

& if not found to open the "Open Remote" window.

My problem is that FM seems to trigger an error BEFORE my open script runs so I never get to direct the user to where i want him to go.

Thanks

Dan

Posted

Set Error Capture. The code for your error is probably 100 (File is Missing); use Get ( LastError ) and if that's equal to 100 (or maybe just > 0) then Open Remote.

Posted

I am using the error capture...

What seems to be happening (because my parent file has a related file,

via "File, Define, File Reference..." ) is that FM can't find the related

file and shows the "Open File" dialogue.

My start-up script never has a chance to even start!!

How can i make sure my script starts BEFORE FM tries to "link" to the remote file that it can't find?

Dan

Posted

Dan:

FMP shouldn't look for the related file if there's nothing in the current layout from that file. Make a new layout that's blank and start from there.

-Stanley

Posted

Hi Stanley,

Thanks for the info...

Maybe I am going about this all wrong...

This is what I do in my start-up script:

Error trapping is ON

I go to a splash screen (based on a table that is in the current file.

(so no related file not found error problem...so far)

That way (based on your info) I know that my start-up script runs before

FM generates any kind of error. - This works so far.

then i switch to a layout that HAS A RELATED table from another file.

Then i have an IF statement to trap for error <> 0.

My thought was that switching to this layout would trigger an error since

the related file would not be found.

All i get is the layout with the words <file missing> where data should be.

It's just like if the If never resulted in a "Yes".

If i turn OFF error trapping then i get the file not found error.

Is there a way to open the related file in both MAC & PC but keeping it hidden??

Maybe I need to try to open it to force an error message and not just

rely on the fact that required info for a layout will be missing,

and assume that missing info will be enough to trigger an error.

Any thoughts??

Maybe my If statement should test for something more specific then

LastError <> 0??

Thanks

Dan

This topic is 7316 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.