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

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

Recommended Posts

Posted

I have a script that does the following:-

Set error Capture [On]

Open [Open Hidden, "Colleger Register"]

if [status(currentError)=0]

SetField[Register Online Status", "Online"]

Else

SetField[Register Online Status", "Offline"]

End if

The script works fine most of the time, but occasionally sets the field to "online" even when the "college register" file has not been found. In other words Status(CurrentError) is returning 0 after an error on open. Anyone any ideas?

Posted

Hi,

Rather than looking for the positive, have you tried looking for the negative. By looking for the actual error may help you out. Error code 100 is File missing.

Set error Capture [On]

Open [Open Hidden, "Colleger Register"]

if [status(currentError)=100]

SetField[Register Online Status", "Offline"]

Else

SetField[Register Online Status", "Online"]

End if

HTH

Posted

You could also use the design function DatabaseNames to check for which files are open

Set Field [Register Online Status, Case(PatternCount(DatabaseNames,"Colleger Register"),"Online","Offline")]

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