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

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

Recommended Posts

Posted

I am trying to write a script that will close the program after so many days. In other words the program is only a demo.

I found this one but I am having problems with it.


If ( IsEmpty ( FirstRunDate ) )   Set Field ( FirstRunDate , Get ( CurrentDate ) ) 

Else  If ( Get ( CurrentDate ) > FirstRunDate + 30 )    Exit Application  

End If

End If

I am obviously putting it in wrong. I made a new table called FirstRunDate, because when I write the script an error occurs, "The table cannot be found" I also wrote it as a field. What am I doing wrong?

I also do not see how to make it start right when the user opens the program the first time. I hope this makes sense. Thank you.

Posted

You should use both the table name and the field name.

Go to Layout [Prefs]

If [isEmpty(Prefs::FirstRunDate)]

Set Field [Prefs::FirstRunDate; Get(CurrentDate)]

Else If [Get(CurrentDate) > Prefs::FirstRunDate + 30]

Exit Application

End If

Prefs is a one-record table (in your case, FirstRunDate could serve the same purpose).

Set the script to run upon opening in File -> File Options.

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