I recently wrote a getLine version that treats backspace correctly (you might wish to choose a better name, though :-): -- getLine' correctly treats backspaces (erasing the deleted characters in output) getLine' = liftM reverse $ getLine'' "" where getLine'' read = do c <- getChar if c=='\n' then return read else do if c=='\b' then do putStr " \b" if null read then getLine'' "" else getLine'' (tail read) else getLine'' (c:read) Regards, -- Bernd Holzmüller ______________________________________________________ INFORMATIK CONSULTING SYSTEMS AG Sonnenbergstraße 13 70184 Stuttgart Telefon: +49 (0711) 21037-37 Fax: -75 mailto:holzmueller@ics-ag.de http://www.ics-ag.de
participants (1)
-
Bernd Holzmüller