Re: how to read from a magnetic card reader

new topic     » goto parent     » topic index » view thread      » older message » newer message

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  
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu