Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

How do I detect if Import was cancelled by user?


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

Recommended Posts

Posted

Hello,

I was wondering how you detect if the user has cancelled importing. I have the Import[] in a script and would like to conditionally perform some operations after that line - depending on whether the user did import the file or cancelled out.

thanks for your help in advance,

sincerely,

J__

Posted

Set Error Capture [on]

# Do not put any steps -- not even comments -- between

# the Import and the Set Field otherwise the error code

# from the import is lost.

Import []

Set Field [ gError, Status( CurrentError )

Set Error Capture [off]

If [ gError = 0 ]

# Import completed normally.

Else

If [ gError = 1 ]

# User Cancelled Action.

Else

# Some other error prevented the import from completing.

End If

End If

Posted

Vaughan,

thanks

Status (CurrentError) - filemaker does not recognize. I'm using Fm7 and I think that routine is no more right? should it be Get ( LastError ) instead?

Question: You mention above that you should not place comments between set error capture and Import[] - is this typical for any errors you want to catch - for example, when a user cancels out of printing do you lose the error code there too if you have comments?

if so, wow, once instance when comments are bad eh?

thanks for the response,

sincerely,

J__

This topic is 7164 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.