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 / How do you use INPUT during the loop?

Author
Message
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 31st Dec 2003 03:44
I decided to fix the video game our teacher asked us to make a while back. My problem was the highscore list - When I use input in the middle of the loop, obviously it would screw up. So does that mean that I have to use a keyboard input catcher instead of the INPUT command, or is there another way?
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 31st Dec 2003 04:13 Edited at: 31st Dec 2003 04:18
go:

im assuming your problem what that the text just rushed down the screen right?

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 31st Dec 2003 04:45
No, no.

If it's in a loop, it will stuff it up 'cos it stops everything unitll you hit enter.

What you do is use the Entry$() command. That simply get's the window's keyboaard entry buffer as a string.

to use it, do something like:



That will show you what you have entered, much like the Input command.

Hope I Hleped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 31st Dec 2003 05:16 Edited at: 31st Dec 2003 05:21
lol, I never knew that command existed because I got confused when the help file spelt it as ENTYR$

Thanks!

edit: I tried it, and it works cool, but it doesn't recognize backspace or return...
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 31st Dec 2003 07:04
Ah, I know, I have come up against that problem before aswell, what you need to do is store the Entry$() buffer in a string, then check the last letter each loop by using Right$(string$,1) for the backspace character and the return character, then, if it detects the backspace character, string$ = Left$(string$,Len(string$) - 1) and then for the return, you need the carrage return symbol, ie, Chr$(10) + Chr$(13)...

Hoep I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2025-06-07 11:01:10
Your offset time is: 2025-06-07 11:01:10