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

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

Recommended Posts

  • Newbies
Posted

I've recently converted a file from FMPro6 to FMPro7. I noticed a lot of unexpected variations in calculation results and also script procedures. On most of those, I was able to change a few things to correct the results.

But there is one that I am having trouble with.

I am using the following script to validate a correct date format entry in performing a FIND in a date field:

If (Get(LastError) = 500)

Clear(Field)

Enter Browse Mode

Show Custom Dialog ["Not a valid date format"]

End If

In FMPro6 this worked fine, but FMPro7 does not seem to recognize the Get(LastError) request. So I am stuck in the middle of a script with an invalid data entry in a date field.

Has anyone had this problem yet?

Posted

Have you tried Set Field [globalnum, Get(LastError)] to see if it may be returning a different error? Also, are you committing the request before the script continues?

  • 2 weeks later...
Posted

I have found the same problem. Rather than relearning error numbers and dealing with the changes, I just changed many of my steps from Get(LastError) = 500 (etc.) to simply Get(LastNumber) to trap any errors. For me, this was the path of least resistance.

  • 7 months later...
Posted

I use Set Error Capture [On] with CommitRecords below(did try and without).

BUT, when I make condition If (Get (LastError) = 507),

it doesnt "see" this number !?!

I made one global field where I've traped Get (LastError) and

I can see the number of Error(in my case 507).

I gave up about using function Get (LastError) for conditions...instead I use Global field - SetField[Global_Field;If(Global_Field = 507)].

Indeed, there is something "weird" with Get (LastError) function in FileMaker7.

I might be just stupid, if someone knows why, please let me know.

Posted

I use Set Error Capture [On] with CommitRecords below(did try and without).

BUT, when I make condition If (Get (LastError) = 507),

it doesnt "see" this number !?!

I made one global field where I've traped Get (LastError) and

I can see the number of Error(in my case 507).

I gave up about using function Get (LastError) for conditions...instead I use Global field - SetField[Global_Field;If(Global_Field = 507)].

Indeed, there is something "weird" with Get (LastError) function in FileMaker7.

I might be just stupid, if someone knows why, please let me know.

Posted

I use Set Error Capture [On] with CommitRecords below(did try and without).

BUT, when I make condition If (Get (LastError) = 507),

it doesnt "see" this number !?!

I made one global field where I've traped Get (LastError) and

I can see the number of Error(in my case 507).

I gave up about using function Get (LastError) for conditions...instead I use Global field - SetField[Global_Field;If(Global_Field = 507)].

Indeed, there is something "weird" with Get (LastError) function in FileMaker7.

I might be just stupid, if someone knows why, please let me know.

Posted

Get(LastError) traps the success or failure of the previous script step. So if there are other steps in there before your If, they may cause your If to show no error. So something like this won't work:

Perform Find []

# Comment Line

If [ Get(LastError) = 500 ]

Show Message [ "Whatever" ]

End If

In this case the LastError was 0 because the comment evaluates without an error. For this reason, it's a good idea to set the global right after the operation you're error trapping.

Posted

Get(LastError) traps the success or failure of the previous script step. So if there are other steps in there before your If, they may cause your If to show no error. So something like this won't work:

Perform Find []

# Comment Line

If [ Get(LastError) = 500 ]

Show Message [ "Whatever" ]

End If

In this case the LastError was 0 because the comment evaluates without an error. For this reason, it's a good idea to set the global right after the operation you're error trapping.

Posted

Get(LastError) traps the success or failure of the previous script step. So if there are other steps in there before your If, they may cause your If to show no error. So something like this won't work:

Perform Find []

# Comment Line

If [ Get(LastError) = 500 ]

Show Message [ "Whatever" ]

End If

In this case the LastError was 0 because the comment evaluates without an error. For this reason, it's a good idea to set the global right after the operation you're error trapping.

Posted

Mike,

Your're absolutly right!!!

I've never seen in my life some function like Get(LastError)...that is influented by simple comment line. Comments are there to be neutral and afford programers to make notes. It "vispers" that there is something "buggy" about function Get(LastError) when it recognizes comment as script line. Anyway, you brought solution and that is most important.

Thanks!

Posted

Mike,

Your're absolutly right!!!

I've never seen in my life some function like Get(LastError)...that is influented by simple comment line. Comments are there to be neutral and afford programers to make notes. It "vispers" that there is something "buggy" about function Get(LastError) when it recognizes comment as script line. Anyway, you brought solution and that is most important.

Thanks!

Posted

It "vispers" that there is something "buggy" about function Get(LastError) when it recognizes comment as script line.

Not necessarily so. Because ScriptMaker is interpretive, it needs to read every statement. Must admit, though, I have never been able to work out why it has to read all of a comment.

This topic is 7185 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.