Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text input problem

Status
Not open for further replies.

darealnash

Programmer
Jul 16, 2005
3
NL
I`m working on a console-based hacking game, and i want to ask for input of commands while still being able to change variables, even if the user doesn`t press any key.
 
There's isn't a command where you can input while a loop is running. However, there are ways to solve this. This is the way I do it:

string$ = ""
oldstring$= ""

do

text 0,0,string$

`input
if oldkey$ <> inkey$()
if asc(inkey$()) <> 8
string$ = string$ + inkey$()
else
if len(string$) > 0
temp$ = ""
for i = 1 to len(string$) - 1
temp$ = temp$ + mid$(string$,i)
next i
string$ = temp$
endif
endif
oldkey$ = inkey$()
endif

sync
loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top