'Variablen Dim Dspval As String * 16 'Anzeige auf Display Dim Temp As Word 'Zwischenspeicher 'Beginn der Benutzereingabe Variabelen Dim Keyread As Byte 'Aulesen der Keypadwerte Dim Key As Byte 'Keyread umgewandet in Wert zw. 1-16, 11=#, 12=*, 13-16=A-D, Dim Digits As Byte ' Dim Point As Byte ' Dim Keyinput As Word 'Eingabe des Benutzers '=============================================================================== '=============================================================================== Deflcdchar 0 , 1 , 3 , 7 , 15 , 7 , 3 , 1 , 32 Deflcdchar 1 , 16 , 24 , 28 , 30 , 28 , 24 , 16 , 32 '=============================================================================== '=============================================================================== Declare Function Userinput(byval Question As String , Byval Length As Byte) As Word Do Userinput Temp , "Benutzereingabe:" , 4 Cls Lcd Temp Wait 3 Loop '=============================================================================== '=============================================================================== Function Userinput(byval Question As String , Byval Length As Byte) As Word Do Ui_start: Cls Cursor Off Locate 2 , 6 Lcd Chr(0) Point = Length + 7 Locate 2 , Point Lcd Chr(1) Keyinput = 0 Digits = 0 Point = 0 Scankeypad: Locate 1 , 1 Lcd Question Locate 2 , 18 Lcd "[ ]" Locate 2 , 19 Lcd Length Locate 2 , 7 Cursor Blink Do Keyread = Getkbd() If Keyread <> 16 Then Gosub Gotkey Waitms 100 If Digits = Length Then Userinput = Keyinput Cursor Noblink Goto Endui End If Loop Loop 'Benutzereingabe Gotkey: Ddrb = 255 Waitms 100 Key = Lookup(keyread , Keydta) Incr Digits Point = Digits + 6 ' Position der Benutzereingabe auf Display Locate 2 , Point Lcd Key Keyinput = Keyinput * 10 Keyinput = Keyinput + Key Return Endui: End Function