< Day Day Up > |
Get(LastError)Category: Get Syntax: Get ( LastError ) Parameters: none Description: Returns the number of the error generated by the most recent script step. If there was no error, then Get (LastError) returns . Use this function in combination with Set Error Capture [On] to trap and handle errors raised in scripts. Examples: Consider the following script: Set Error Capture [On] Print Setup[Restore] Get (LastError) If the user cancels out of the Print Setup dialog, Get (LastError) returns 1 (user canceled action). If the Print Setup step executes successfully, Get (LastError) returns . Comments: The Get (LastError) function returns the error code from only the most recently executed script step. For example, in this script: Perform Find If (Get(ErrorCaptureState) = 1) Show Custom Dialog (Get (LastError)) End If The Get (LastError) step returns the result of the execution of the If statement, not the error code generated by the Find step. A full list of error codes is available in the FileMaker Help system under Get(LastError) . |
< Day Day Up > |