Page 1 of 1

PostPosted: Sun Sep 22, 2002 12:38 pm
by slartibardfast
Hi,
I have been attempting to add a time display to an application that uses Ptoolbox's "Fevent(1)" function and have hit a brick wall.
This is the code without "Fevent(1)", It displays the time in the title bar.

main() {
graph_on();
while (1) {
title(time(1));
}
}

This is the code with "Fevent(1)", It displays the time, but does not update it!

library "PToolboxLib"
include "Fctl.h"
int e;

main() {
while(1) {
title(time(1));
e=Fevent(1);
switch(e) {
case 5:
break;
case 6:
break;
}
}

What am I missing? Any help or suggestions appreciated!
Thanks!

-David Connolly
davidc@alphasols.com

PostPosted: Sun Sep 22, 2002 2:58 pm
by jstadolnik
As per the documentation, a wait value of 1 is an indefinite wait, meaning that it will only return when an event is trapped... it's just like PocketC's built-in event() call in that respect. Use a non-1 value.

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm

PostPosted: Sun Sep 22, 2002 8:08 pm
by slartibardfast
I just assumed a non-1 value returned control to pocketC permanatly.

Thanks a million!


-David Connolly
davidc@alphasols.com

PostPosted: Tue Sep 24, 2002 12:59 am
by jstadolnik
Sure, I like easy ones! ;)

Joe

The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm