December 8, 201015 yr For the purposes of the LastError value being updated, what actually constitutes a script step... E.g. does an If enclosure constitute an error (if no one knows i'll run some tests my self). [error thrown here] If[ Get(LastError) > 0 ] Exit Script[ Get(LastError) ] End If Does the script exist with the error thrown at [error thrown here] line or the result of the if clause??
December 8, 201015 yr FileMaker errors will not actually stop scripts so what you are describing should work - i.e.: you should get the error number as a result of the script.
December 8, 201015 yr Author Im aware of that : - i'm interested in what Get(LastError) would be storing at the point the script exits... would it be the step that threw the error or 0 as a result of the if script step executing successfully.
December 8, 201015 yr The IF never changes the last error - and so the last error will be saved ... I created a simple script that tries to find an invalid value - returned Error Number 401 and then added your exact script steps (except that I set (a variable to the Error) - and the variable held 401 at the end. Are you trying to store the last error? My understanding is that the script result will only really be valid if you run another script. I would store the error in a variable called $ERROR (global variable) so I could check it out (FM Advanced).
December 8, 201015 yr i'm interested in what Get(LastError) would be storing See if this helps: http://help.filemaker.com/app/answers/detail/a_id/7071
December 9, 201015 yr Author Thanks Comment, It seems a bit retarded that things like show custom dialog and set variable would clear the last error state ... as far as i know they don't throw any error's. On the up side, at least script exits with no user notificatoin become simpler ... and for anything else i suppose we'll just continue storing the error in a variable inside the construct.
Create an account or sign in to comment