Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7253 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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

Posted

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

Posted

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

This topic is 7253 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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