Re: how to read from a magnetic card reader
- Posted by cargoan Jan 14, 2011
- 1248 views
Use:
integer vca = -1 sequence linea = {} -- wait until there is something to read while vca = -1 do vca = get_key() end while linea &= vca -- start reading while 1 do vca = get_key() if vca = '\n' then exit elsif vca != -1 then linea = linea & vca end if end while
Or:
include std/console.e -- start reading linea = {} while 1 do vca = wait_key() if vca = '\n' then exit else linea = linea & vca end if end while