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 / DBP- User input

Author
Message
Penguin Boy
18
Years of Service
User Offline
Joined: 22nd Apr 2006
Location:
Posted: 3rd Aug 2006 11:46
Ok, there's 2 qeustions here:

1. when useing the INPUT command (eg. INPUT "Type here:", reply$" I want my program to be able to distinguish between words. This is for a console, so i want to be able to type in somthing like:

load "crate.X"

and the program should look at the input and got the Load function (in my program) and then use "crate.X"

2. How do i detect if a key is being pressed, BUT not use the rightkey () or somthing like that. possibly useing the ascii codes?

Thanks for reading.

God you're ugly...
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 3rd Aug 2006 12:22 Edited at: 3rd Aug 2006 12:22


you mean that?

and:



B-DA FIRE!
Penguin Boy
18
Years of Service
User Offline
Joined: 22nd Apr 2006
Location:
Posted: 3rd Aug 2006 12:48
you hit the nail on the head for the keystate one.
Thanks!

But is there anyway for the input command to get 2 varibles, with only 1 prompt?

so it would ask
"Object to load:"
and you could specify the name AND the number in one line. Thats what i want to be able to do.

God you're ugly...
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 3rd Aug 2006 12:50 Edited at: 3rd Aug 2006 13:00
i tryed with the number,

it was in my Game Master editor,but i couldnt figure it out in the minute...

edit:

i got you this:



B-DA FIRE!
Penguin Boy
18
Years of Service
User Offline
Joined: 22nd Apr 2006
Location:
Posted: 3rd Aug 2006 13:02
ok, thanks.

i geuss ill have to stick with 2 prompts... *sigh*

God you're ugly...
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 3rd Aug 2006 13:04
i had that problem too.

it took me ages to find out...

B-DA FIRE!
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 3rd Aug 2006 14:32 Edited at: 4th Aug 2006 15:17
No, you don't need two prompts!

Use one prompt:

input "File and number to load (seperated by a space): ",FileInput$

Then use Mid$ to find the space in FileInput$, and copy the stuff to the left of the space to your Filename variable, and the VALue of the stuff to the right as your ObjectNumber variable.

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 3rd Aug 2006 16:04 Edited at: 3rd Aug 2006 16:05
Dream and Death you read my mind But you may want to use a ";" or some other character if the thing that you input has spaces

Login to post a reply

Server time is: 2024-11-26 14:49:51
Your offset time is: 2024-11-26 14:49:51