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.

DarkBASIC Discussion / Help with input

Author
Message
dj BlackDragon
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location: who knows
Posted: 16th Sep 2004 07:18
Ok. The title might be misleading. I know how to get user input and store it for use later on, but I would like to know if there was anyway to make it so when the user hits enter it doesnt automaticaly run the code.

P.S. If you need to see some code, here it is:


Visit the Dragon Games homepage @ www.angelfire.com/dragon2/dragonsinc/index.html
or go to the forums @ http://djblackdragon.proboards3.com
dj BlackDragon
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location: who knows
Posted: 16th Sep 2004 11:31
Could someone please help me. I really want to get this done.

Visit the Dragon Games homepage @ www.angelfire.com/dragon2/dragonsinc/index.html
or go to the forums @ http://djblackdragon.proboards3.com
Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 16th Sep 2004 13:49
I'm not exactly sure what your trying to do.. could you explain in better detail please?

- Merix
dj BlackDragon
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location: who knows
Posted: 17th Sep 2004 07:46
Ok. sorry. I'm using the input parameter thingy to collect input (go figure). When you use it in a normal situation you hit enter to get it to go to the next scene or point of gameplay. But thats not what I need to do. Wjat I need it to do is:wheni the user hits enter it just goes down without collecting and saving the input for further use. Run that code and you will see what I mean.

Visit the Dragon Games homepage @ www.angelfire.com/dragon2/dragonsinc/index.html
or go to the forums @ http://djblackdragon.proboards3.com
dj BlackDragon
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location: who knows
Posted: 17th Sep 2004 11:30
Is ther even a way to do that?

Visit the Dragon Games homepage @ www.angelfire.com/dragon2/dragonsinc/index.html
or go to the forums @ http://djblackdragon.proboards3.com
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 17th Sep 2004 11:31
dj,
Are you saying that when the user presses "Return" you want the cursor to jump to a new line?
Or;
Do you want it so that the program can be doing other things, and the user has the ability to change the text in a "text box" at any time he/she likes?
Something like, you click into it, and you can give it input ( while in the background box's could be flying around ) and then you click out of it to stop input ( and the box's continue to fly around )?

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 17th Sep 2004 13:22
....I'm probably insulting your intelligence DJ.

input "Type something:",myvar$

print "You have typed:"+myvar$

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
dj BlackDragon
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location: who knows
Posted: 18th Sep 2004 06:21
@Jess: Yes that is what I am trying to say. I am making a programming language and i need it to go doen a line when the user hits "enter" on the keyboard but I wasn't sure if it was possible.

Visit the Dragon Games homepage @ www.angelfire.com/dragon2/dragonsinc/index.html
or go to the forums @ http://djblackdragon.proboards3.com
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 18th Sep 2004 07:31


Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
dj BlackDragon
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location: who knows
Posted: 18th Sep 2004 08:10
And no, bear crazy, you did not insult my inteligence. I have been around long enough to know a lot of stuff.But recently I have been having problems figuring stuff out so I took a break. Anyway, Any Ideas?

Visit the Dragon Games homepage @ www.angelfire.com/dragon2/dragonsinc/index.html
or go to the forums @ http://djblackdragon.proboards3.com
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 18th Sep 2004 14:21
Well, Dj, unless you write your own input routine ( or grab one from the Snippets or CodeBase and modify it ) you wont be able to do it, as DB detects when the user presses Enter/Return and continues the flow of the program if they do.

I have my own routine, but it's not exactly what you're looking for ( it has full input, deleting, left/right key movement and entry of input into middle of the string, but the way it's set up, you wouldn't be able to put in return checking ).

Have a look around the CodeBase, or in the Snippets forum and see if you can modify one to detect for a return key press. And then in the string that is receiving the input, put a special character of some sort, and when you paste the sting to the screen, detect for this special character, and if it exists, start printing on the next line down.

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 19th Sep 2004 06:50
Might I suggest you give us an example (in text here) of what you want the input to look like. I tried runing your code and it looks normal to me, that is, what I would have expected it to look like. I'm afraid I don't understand that nature of your trouble...
S.

Any truly great code should be indisguishable from magic.
dj BlackDragon
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location: who knows
Posted: 19th Sep 2004 11:10
here:

1. The user has a CLI that they have to type in the code they want to run.

2.then when the user hits enter it goes down to the next line.

sorry if I didnt explain enough but I haven't really typed in any questions here for awhile.

Visit the Dragon Games homepage @ www.angelfire.com/dragon2/dragonsinc/index.html
or go to the forums @ http://djblackdragon.proboards3.com
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 20th Sep 2004 09:42
That's still not enough I'm afraid... I get;

_cube_
size> _50_

(cube made)
(end of processing)

for the snip you gave up above. The underscores are the beginning and end of the user typing. What SHOULD it look like?

Any truly great code should be indisguishable from magic.
Floyd
21
Years of Service
User Offline
Joined: 11th Sep 2003
Location:
Posted: 21st Sep 2004 12:36
You're making your own programming language? Perhaps you want to collect lines of code until you've read until the end of a program or a subroutine or whatever a basic unit of compilation or interpretation is. Something like that maybe? Then put your input routine in a loop and define some symbol in your language the tells you when to leave the loop.

However, if you're doing something like that, all your objects are being made with object number 1. So I would initialize objex to 1 before entering the loop and increment it with objex = objex + 1 after making each object. Also I would use objex in the code creating each object instead of hard coding a 1, so something like

make object cube objex,size#
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 22nd Sep 2004 05:33
NOTE IF THIS IS 100% IRRELEVANT (): i haven't read the source code, by the way

function UpdateStuffTyped()
if inkey$()<>"" then keyBuffer$=keyBuffer$+inkey$() : wait 35
endfunction

From there, to clear the keybuffer type keyBuffer$="".

To check for the enter key just use if returnkey()=1 then `whatever

Seriously, i dont no what u mean! Help!

[img src=http://blanky.pt-web.net/ddd.gif] >::p

Login to post a reply

Server time is: 2025-05-24 19:40:57
Your offset time is: 2025-05-24 19:40:57