Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:112)
OrbWorks Community Forum • View topic - Time Continues

Time Continues

Discuss OrbForms Designer and PocketC Architect

Postby Gazza on Mon Nov 07, 2005 9:13 pm

Help Needed!

On my App I have a timer, when I switch the device off the timer continues processing the clock. I need to pause the clock when the device is switch off and restart when switched back on? I had a look through the OnKey Events, though it does not cover the off button?

Thanks Gaz
Gazza
 
Posts: 146
Joined: Sat Jan 12, 2002 1:56 am
Location: United Kingdom

Postby dewey on Tue Nov 08, 2005 4:23 am

The timer events do not fire when the device is turned off. However, the system clock continues to run.
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby Gazza on Tue Nov 08, 2005 3:27 pm

Hi Dewey,

// I am using this in the timer
game.time = (game.gTime.secs - game.bTime.secs) + appPrefs.time;

//And this when the form is closed
appPrefs.time = game.time;

This works if you leave the mainForm, but does not work if the device is switched off?

I have found this in the FORUM :-

#define VK_OFF 0xDF

I think this reads the memory for the On/Off Switch, though the Define statement is not working in Orbforms. Can you Peek & Poke to memory addresses in the palm?

Cheers Gaz
Gazza
 
Posts: 146
Joined: Sat Jan 12, 2002 1:56 am
Location: United Kingdom

Postby Gazza on Wed Nov 09, 2005 5:14 pm

Really stuck on this one, I don't really want to go down the Native Plug-in root.

There maybe a simpler solution,

The power button is passed to the KeyDownEvent, but does not fire the onhkey handler?

I am using the Date Object, I imagine this is the real-time clock as it does not stop. Can I access the main clock as this one is stopped when switch off?

Problem solved, I used ticks() :-)
Gazza
 
Posts: 146
Joined: Sat Jan 12, 2002 1:56 am
Location: United Kingdom


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 2 guests

cron