Avoid starting a program after a given time

Arrie

Member
Licensed User
Longtime User
Hi all,

I'm working on a pool program for the euro 2008. Competitors must fill in a form, and the data will be stored in a .csv file (with encryption). Now i want to avoid that this form is opened after 7th of June 2008 18:00. I'm trying it with timeparse and timeadd, but i can't find the solution.

thx Arrie
 

Cableguy

Expert
Licensed User
Longtime User
You will have to chech if the current date and time is off your allowed time span..
To do so you will need to first set the ticks to the date you want:

enddateticks=dateParse("07/06/2008") ´Must be formated the same as Date Format

Then You Must get the hours tick value:

endhourTick=DateParse(Date(Now))-Timearse("18:00") ´Again it must be formatted as Time Format

Then the Total Ticks At 7th of June 2008 18:00 will be EndDateTicks+EndHourticks.

All you need now to do is to check if the time when a form is validadted, or shown, is larger thatn that of the closing date...

if Now=>TotalTicks Then MSGBOX("Entrys Not Allowed after 7th of June 2008 18:00."
 

Arrie

Member
Licensed User
Longtime User
Hi Cableguy,

Just made a small adjustment for the timevalue. I've changed it to "endhourtick = cTicksPerHour * 18"

many thanks,

Arrie
 
Top