Thanks for your help Ryan. I am still having problems though...firstly, was that written in DBC? Anyway, i've taken your lead and had a go at one myself. It's smaller than yours as once the user presses the RETURN key I can exit the loop. What is happening is that it prints the text out to the screen in real time, except that if I press the BACKSPACE key (keystate(14)) the whole string gets cleared, instead of just the last character!!!
Could anyone take a look and help me out please?
SYNC ON
CLS
DIM RealTimeText$(3)
` 1 - Text
` 2 - New Key
` 3 - Old Key
WHILE RETURNKEY() = 0
ConsoleOutput$ = RealTimeInput()
TEXT 0, 0, ConsoleOutput$
SYNC
CLS
ENDWHILE
FUNCTION RealTimeInput()
IF KEYSTATE(14) = 1
RealTimeText$(1) =LEFT$(RealTimeText$(1),(LEN(RealTimeText$(1))-1))
returntext$ = RealTimeText$(1)
EXITFUNCTION
ENDIF
RealTimeText$(3) = RealTimeText$(2)
RealTimeText$(2) = INKEY$()
IF RealTimeText$(2) <> RealTimeText$(3)
RealTimeText$(1) = RealTimeText$(1) + RealTimeText$(2)
ENDIF
returntext$ = RealTimeText$(1)
ENDFUNCTION returntext$
Life is like a penis:
When it's soft you can't beat it, when it's hard you get screwed.