Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / question about input on image

Author
Message
ithilgore
21
Years of Service
User Offline
Joined: 1st Oct 2002
Location:
Posted: 26th Dec 2003 02:42
well the problem is that i want the user of the programme to input a letter (from a to d) but the background of the screen is a loaded image.When i do the following a blue screen will appear instead of the image.On the other hand,when i delete the command input everything is okay...can you help me?
BearCDPOLD
20
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 26th Dec 2003 08:33
I know gotos and gosubs are fun to play with, but it's really beneficial to start using functions. Gotos seem to get confused on where they need to go sometimes, and all sorts of crazy stuff starts happening. But I'll help you with your input problem instead of giving a lexture on functions (since that can get rather boring).

Step 1elete input, input is evil. If you let input take you over you will live in a dark cave calling it your "precious" and it will poison your mind. Well.. not quite, but input is not the best way to detect key presses. Inkey$() is good for that. It looks like you're doing a quiz or testing program, Inkey$() will definitely serve you well.

the syntax for inkey$() is here:

INKEY$()=<String containing current key[s] being pressed>

How would you detect multiple keys?
if inkey$()="Key1" and inkey$()="Key2" then yattayattayatta

Input stops all program activity as it waits for user input. inkey$() is just constantly watching AS the program runs to see if the key you are looking for is pressed at any time.

Juvenile Industries
Current Project: The First Room (FPS)
Soon to come:An rts, and a snowball fight game
ithilgore
21
Years of Service
User Offline
Joined: 1st Oct 2002
Location:
Posted: 28th Dec 2003 19:20
thanks.it works fine.

Login to post a reply

Server time is: 2024-09-21 13:49:01
Your offset time is: 2024-09-21 13:49:01