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 / text input

Author
Message
Bob_42
19
Years of Service
User Offline
Joined: 15th Sep 2006
Location: Guernsey
Posted: 15th Oct 2006 02:00 Edited at: 15th Oct 2006 02:01
i found this input function in the code snippets (the thread is now closed, thats why i'm posting here), and i changed it a bit for my needs, but it seems to have a major floor, whenever i try to delete(i.e. hit backspace) it comes up with weird straight line character similar to '|' but shorter, and whenever i run the function for a second time this character appears at the start, and i've looked through the function and i can't see anything that could be causing it, anyone see what the problem is?



Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Oct 2006 04:20
I didn't see anything odd. The only changes i'd do is change "scancode" to "keystate" and add a timer to slow down backspacing. You should try compiling that and running the .exe on one of your friends computers.
Bob_42
19
Years of Service
User Offline
Joined: 15th Sep 2006
Location: Guernsey
Posted: 15th Oct 2006 18:14
i have solved the problem, thanks anyway

basically when you hit backspace it goes into the if statement and delets the right-most letter, however backspace is also counted in entry$() command, (the short vertical line), i found this out when got rid of the delete command, the line just kept comming up, so all you to do is put it in a if-else-endif statement:



similarly the line was coming up at the start the second time i used it because the last button i had pressed was enter, and the line must come up with the enter key as well

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Oct 2006 20:04
Ah. I should of noticed sorry about that. I usually do text input like this:



Before it goes out of backspace it makes a$="" so it's not added to the string.

Login to post a reply

Server time is: 2026-07-07 11:20:56
Your offset time is: 2026-07-07 11:20:56