Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Avoid starting a program after a given time

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-30-2008, 11:14 PM
Junior Member
 
Join Date: May 2007
Posts: 21
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-30-2008, 11:42 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
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 - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #3 (permalink)  
Old 05-31-2008, 09:06 AM
Junior Member
 
Join Date: May 2007
Posts: 21
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 Off
Pingbacks are Off
Refbacks are On

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


All times are GMT. The time now is 09:42 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0