April 14, 200520 yr 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__
April 14, 200520 yr 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
April 14, 200520 yr Author 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__
Create an account or sign in to comment