Sergey K, with a couple of edits, your code does work. DBC does not recognize two forward slashes as the beginning of a REM statement.
mediafanatic, I have some code you could try also:
sync on : sync rate 60
hide mouse
TotalLength = 15 : TimeToGo = 0
s$ = "" : b$ = "Please enter some text: "
repeat
cls
a$ = entry$(): rem here ya go..
s$ = s$ + a$ : if len(s$) >= TotalLength then s$ = left$(s$,TotalLength) : TimeToGo = 1
if returnkey() = 1 then TimeToGo = 1
clear entry buffer
text 0,0,b$ + s$
sync
until TimeToGo = 1
cls
ink rgb(255,255,0),0 : ` yellow
text 100,100,"Your string is " + s$
sync
end
My screen flickers unless I do it something like this. Maybe it's my comp or Windows 7 or something, but this works fine for me. It clears the entry buffer every time, so you can check if the key pressed is what you want (i.e. you may want only numbers, only letters, etc).
So many games to code.....so little time.