Avoid starting a program after a given time

Discussion in 'Questions (Windows Mobile)' started by Arrie, May 31, 2008.

  1. Arrie

    Arrie Member Licensed 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
  2. Cableguy

    Cableguy Expert Licensed 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."
  3. Arrie

    Arrie Member Licensed User

    Hi Cableguy,

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

    many thanks,

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice