Input2$ problem with cls

Blitz3D Forums/Blitz3D Beginners Area/Input2$ problem with cls

H!

I have a simple input function.
And that is working 98% oke, the only problem is when people using the backspace key.

I can't use the cls in the function before
Text 0,(scrH-FontHeight()),w$

because my game will cls and don't redraw.

And I don't want to use this code in my main game loop but only as an function.

Is that possible ?

Only need to redraw the text and not the other things.

Function inputText$()
FlushKeys
w$=""
	Repeat
		c=GetKey()
		If c<>0 And c<>9 And c<>13 And c<>27 Then ;geen tab,0,enter,esc

			If c=32 And h=32 Then
				c=32	
			Else
				If c=8 Then ;backspace
					w$ = Left$(w$,(Len(w$)-1))
				Else
					w$ = w$+""+Chr$(c)
				EndIf
			EndIf
		h=c

		Text 0,(scrH-FontHeight()),w$
		Flip
		EndIf
	Until KeyHit(28)
	
FlushKeys
Return w$
End Function