[?]Need help!!!!

Postby walfisch on Thu Jan 24, 2002 10:00 am

<font face=Comic Sans MS>
<img src=icon_smile_big.gif border=0 align=middle>
I have a problem: I want to programm an application in wich beeps and while it beeps, I want to press a button, with which I can stop the beep and do something other. Can you help me?
(The main problem is, that I want to run two functions at one time: first the beeps and second a function which allows me to stop the first by tapping on the screen)
I will be glad, if you can help me
PS:Sorry if my english isn't so good, but I'm a swiss
</font id=Comic Sans MS>
Posts: 4
Joined: Thu Jan 24, 2002 9:52 am

Postby soinsg on Thu Jan 24, 2002 5:05 pm

This code works on the emulator:

// Beeps and Taps
// Beeps twice a second until
// the stylus taps the screen

int e, keepGoing=1;

main() {
/* Keep looping until 'keepGoing' doesn't equal 1 */
while (keepGoing == 1) {
e = event(50); // Wait for upto 1/2 second
if (e == 2) // Pen down event
keepGoing = 0;
tone(700, 20); // tone(frequency, milliseconds)
Posts: 198
Joined: Thu May 17, 2001 4:26 pm

Postby walfisch on Thu Jan 31, 2002 7:12 pm

Thanks, it WORKS!!!!!!
Posts: 4
Joined: Thu Jan 24, 2002 9:52 am

Return to PocketC for Palm OS KB

Who is online

Users browsing this forum: No registered users and 1 guest