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.


How to create endless loop with keypress


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-17-2007, 04:38 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 203
Default How to create endless loop with keypress

Hi,

In the former days of programming I used an endless loop in a subroutine to keep on going with a keypress to stop. Anybody got an idea how to do this with DO UNTIL or DO WHILE?
Marc
Reply With Quote
  #2 (permalink)  
Old 05-17-2007, 04:48 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,335
Default

It is better to leave this method for the former days of programming
It can be achieved using the DoEvents keyword.

Using events driven programming you could just use the KeyPress event to do what you like.
Reply With Quote
  #3 (permalink)  
Old 05-17-2007, 04:56 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 203
Default

Yes, Erel, I agree but I want to create an endless loop to keep on going (like bounce a ball against the screensides) without using the timeticksub.
Marc
Reply With Quote
  #4 (permalink)  
Old 05-17-2007, 05:02 PM
Junior Member
 
Join Date: May 2007
Posts: 46
Default

Hi, I don't know if it is what you really want, but endless loop you can make this way :

do until 0 = 1
doevents
loop

Petr
Reply With Quote
  #5 (permalink)  
Old 05-17-2007, 05:59 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,335
Default

There are no OnKey or InKey keywords in Basic4ppc as it is an event driven.
Why don't you want to use a timer?
Reply With Quote
  #6 (permalink)  
Old 05-17-2007, 07:51 PM
Basic4ppc Veteran
 
Join Date: Apr 2007
Posts: 203
Default

The timer is to slow for what I want I think. I solved the problem in a "for next" loop. Now the ball really bounces (see post moving figures)
Marc
Reply With Quote
  #7 (permalink)  
Old 05-17-2007, 08:06 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,463
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Hi

were is "Moving figures"??
__________________
Paulo Gomes
Porto, Portugal

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

DLL Version Listing
Reply With Quote
  #8 (permalink)  
Old 05-17-2007, 08:19 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 487
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Moving images refers to this topic How to create sprite/ moving figures?

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #9 (permalink)  
Old 05-17-2007, 08:31 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 1,463
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

RandomCoder I don't think that was what he refered to, since he talks abou using a for next loop.
I think he is preparing a new post?
Maybe Im wrong, I don't know...
__________________
Paulo Gomes
Porto, Portugal

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

DLL Version Listing
Reply With Quote
  #10 (permalink)  
Old 05-17-2007, 08:41 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 487
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Stellaferox used a for next loop to bounce the ball. I'm presuming that's what he's refering too.

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
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
getting the Pressed Key in the KeyPress event Cableguy Questions & Help Needed 2 09-05-2008 06:17 PM
Keypress ceaser Questions & Help Needed 2 05-28-2008 05:21 AM
Keypress and SelectionChanged.. robee9931 Questions & Help Needed 1 05-27-2008 04:08 PM
Delete keypress emaster Questions & Help Needed 2 12-04-2007 07:15 AM
Endless loop Cableguy Questions & Help Needed 8 06-28-2007 05:36 PM


All times are GMT. The time now is 07:22 PM.


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