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.

Status(CurrentError) in Script ?

Featured Replies

I am really getting confused, here is what i did in 2 different databases.

Allow User Abort[off]

Set Error Capture [on]

# This script just restore a value for an actor flag

#

Perform Script[Restore Actor Flag]

#

Go To Layout [search Actor]

Enter Find Mode[pause]

Perform Find [replace found set]

#

# Sets g_CurrentError(global, number) field value

#

Set Field[g_CurrentError, Status(CurrentError)]

#

Show Custom Dialog[Title:g_CurrentError:g_CurrentError: "OK",","]

# The rest of the script just checks for the value of g_CurrentError and displays the value if not 0 in an message and sends the user back to main menu.

# If the value is 0 it displays the found set in a portal.

#

Now here is my problem. I have this script in two different database, Movie, and Actor. The scripts are exactly alike except for the neccessary field name changes unique to the Databases.

In Movie, this script works without exactly as i wrote it without fail. If the find is empty it shows a error value of 400 and the message i assigned. If there is not data it shows and error of 401 and the message I assigned. If the value is not 0, and not 400 or 401, it shows the value and the message i assigned.

Now, in the Actor Database, the same script with different fieldnames of course, acts i ways i cannot understand.

1st) If I leave the find "blank" it displays all the records in my DB. And returns an error value of 0 on a test custom dialog message i inserted after the perform Find to aid in diagnostics.

2nd) If I enter a value that should result in "no data found"....; it shows a error value of 0.

** I even modified the script to check the Status(CurrentError) field itself and still none of my If steps were followed or executed (This just leads me to believe that Status(CurrentError) is not being changed even when i put it an error causing situation. **

So, basicly i guess the error is either not being detected or not being set in Status(CurrentError).

But why does this exact same script work in my Movie db just as I expected it to.

Please help me... I am going nuts trying to learn this FM stuff... just when i think i understand something ... I do something like this to really confuse myself.

Any help would be appreciated.

Hi DMilbrath,

Any time you perform a sub-script (or external script) you leave your Error trapping behind. Slide it down so it is after the Perform Script[Restore Actor Flag].

Unfortunately, I'm pretty brain-dead tonight and there may be other issues in your script which I can't spot. But this will certainly cause your error trap to fail on your find.

LaRetta smile.gif

Due to a bug, FileMaker 5 & 6 considers a comment line as a successful script step

If you use comment lines to make your script more readable, be sure not to put ANY comment lines between Status(CurrentError) and the step you are checking

  • Author

Thank you all.

It turns out the "comment line" was causing the problem. CobaltSky, LaRetta, and qdurniak have been a great help and pointed out my errors.

Thanks again

Dan

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.