Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Avoid starting a program after a given time


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-31-2008, 12:14 AM
Junior Member
 
Join Date: May 2007
Posts: 16
Default Avoid starting a program after a given time

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
Reply With Quote
  #2 (permalink)  
Old 05-31-2008, 12:42 AM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,343
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

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."
__________________
Paulo Gomes
Porto, Portugal

PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD
PPC: Qtek9000, 1GB SD

DLL Version Listing
Reply With Quote
  #3 (permalink)  
Old 05-31-2008, 10:06 AM
Junior Member
 
Join Date: May 2007
Posts: 16
Default

Hi Cableguy,

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

many thanks,

Arrie
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
avoid using goto paul j Code Samples & Tips 0 11-11-2007 12:56 PM
I'm starting to distill myself... Cableguy Questions & Help Needed 4 09-14-2007 06:11 PM
Error when loading table how to avoid tvrman Questions & Help Needed 2 08-04-2007 09:32 PM
Starting question Gale Johnson Bug Reports 2 07-30-2007 10:32 PM
Quick question to avoid going down a long dead end route LineCutter Questions & Help Needed 2 05-22-2007 08:29 AM


All times are GMT. The time now is 02:34 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0