home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 April / CHIP4_98.ISO / software / ccconrad / basic.exe / CHIP / Programme.Bas / Beispiele_2 / TASTEN1.BAS < prev    next >
Encoding:
BASIC Source File  |  1997-05-21  |  798 b   |  38 lines

  1. '**************************************
  2. '
  3. ' C-Control/BASIC       TASTEN1.BAS
  4. '
  5. ' Aufgabe:
  6. '
  7. ' - Tastatureingabe mit Zehnerblock
  8. ' - Senden des Ergebnisses an den PC
  9. '
  10. '**************************************
  11. ' --- Definitionen --------------------
  12.  
  13. define Eingang wordport [1]
  14. define Eingabe Word
  15. define Taste byte
  16. define N byte
  17. ' --- Programmoperationen -------------
  18.  
  19. Eingabe = NOT Eingang
  20. #Loop
  21.   wait (Eingabe <> (NOT Eingang))
  22.   Eingabe = NOT Eingang
  23.   for N = 0 to 11
  24.    if ((Eingabe shr N) AND 1)=1 then Taste=n
  25.   next
  26.   if Taste < 10 then print Taste
  27.   if Taste = 10 then print "*"
  28.   if Taste = 11 then print "#"
  29.   wait (Eingabe > (NOT Eingang))
  30.   Eingabe = (NOT Eingang)
  31.   pause 25             '0,5 s warten
  32. goto Loop              'Endlosschleife
  33.  
  34.  
  35.  
  36.  
  37.  
  38.