Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXTRA! Basic programming 3

Status
Not open for further replies.

johnsearcy5

Technical User
Jun 28, 2004
6
US
Is there a website that may have lessons or tutorials I can go to and learn this language? Maybe a book I can purchase? I have created some macros at work and I don't quite have the knowledge to make it work as i see it in my mind. Any information would be appreciated.

 
Oops begin should have been began. you could also add a case to handle the user pressing something unexpected.

began = timer
While RC = 0 and not timeout
select case true
Case MySess.WaitForKeys(0,"A")
rc = 1
Case MySess.WaitForKeys(0,"B")
rc = 2
Case MySess.WaitForKeys(0,"C")
rc = 3
Case MySess.WaitForKeys(0)
msgbox "You must enter a A,B or C to continue."
end select
end = timer
if timer - began => 120 then timeout = true
Wend

The Case MySess.WaitForKeys(0) needs to always come after you've first checked for all the keys your expecting. If it's moved up in the stack it will pop on any key (including one you want to handle differently) that falls below it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top