Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Get(Lasterror) - What Constitutes A Script Step

Featured Replies

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??

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.

  • 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.

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).

i'm interested in what Get(LastError) would be storing

See if this helps:

http://help.filemaker.com/app/answers/detail/a_id/7071

  • 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.

Hm... let's see:

error.zip

  • Author

Hmmm...

Yeah fair enough.

Cheers for the injection of logic.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.