WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Loop Forever until SHIFT Key Pressed

Keywords:     IsKeyDown

Question:

How do I implement a 'Do forever" loop with a "Press Any Key to Quit" exit?

Answer:

Well, we cannot do "press any key" but how about a SHIFT key?
count=0
BoxOpen("Hello - Press Shift to exit",count)
while 1
   count=count+1
   TimeDelay(1)
   BoxText(count)
   if IsKeyDown(@SHIFT) then break
endwhile
Message("Do Forever exited at",count)

Article ID:   W13167
Filename:   Loop Forever until SHIFT Key Pressed.txt
File Created: 2001:01:15:10:57:58
Last Updated: 2001:01:15:10:57:58