Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

Easy question


(!)

motocross95's Avatar
motocross95 motocross95 is offline
Member with 110 posts.
THREAD STARTER
 
Join Date: Oct 2001
29-Nov-2001, 08:24 PM #1
Easy question
Someone should be able to help me on this one. I currently have a loop, how do I perform the loop until someone presses any key. Or better yet, perform it until someone presses ESC. Thank you
Rockn's Avatar
Computer Specs
Member with 21,189 posts.
 
Join Date: Jul 2001
Location: Somalia of the North, MN
Experience: Disenfranchised American
29-Nov-2001, 10:27 PM #2
A loop in what context? In the context of a program looping a statement until the escape key is pressed?
motocross95's Avatar
motocross95 motocross95 is offline
Member with 110 posts.
THREAD STARTER
 
Join Date: Oct 2001
29-Nov-2001, 10:40 PM #3
yes loop a statement until the Esc key is pressed.
owen68's Avatar
owen68 owen68 is offline
Junior Member with 10 posts.
 
Join Date: Nov 2001
Location: Oxford, Uk
30-Nov-2001, 11:29 AM #4
Looping
It depends on the language your programming in but you need to use a Do While loop or the equilvalent.

Do (while test is False)

Whatever you want to do

Test

Loop
motocross95's Avatar
motocross95 motocross95 is offline
Member with 110 posts.
THREAD STARTER
 
Join Date: Oct 2001
30-Nov-2001, 03:25 PM #5
I'm sorry I forgot that. Visual Basic 6. I know the structure for it, but just can't figure out the command that would do it.

Do while (Command goes here) = false

Loop

or something that does the same thing. Thank you
TimCottee's Avatar
TimCottee TimCottee is offline
Member with 186 posts.
 
Join Date: Oct 2001
Location: Southampton, England
04-Dec-2001, 05:55 AM #6
Here is a simple example:

Private blnContinue As Boolean

Private Sub Command1_Click()
blnContinue = True
Do While blnContinue
Text1.Text = Now()
DoEvents
Loop
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
blnContinue = False
End If
End Sub

Private Sub Form_Load()
Me.KeyPreview = True
End Sub
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2