Home

Add

Edit

Without Linenumbers

Code in Textfield


  1. Screenres 400, 300, 32
    
  2. 
    
  3. Dim TKey As String
    
  4. Dim TKey1 As Ubyte
    
  5. Dim TKey2 As Ubyte
    
  6. Dim TInput As String
    
  7. Do
    
  8.     TKey = Inkey()
    
  9.     TKey1 = Asc(Left(TKey, 1))
    
  10.     TKey2 = Asc(Mid(TKey, 2, 1))
    
  11.     Select Case TKey1
    
  12.         Case 0
    
  13.         Case 8: If Len(TInput) > 0 Then TInput = Left(TInput, Len(TInput) - 1)
    
  14.         Case 10, 13: If TInput <> "" Then Exit Do 'Nur verlassen, wenn eingabe nicht leer.
    
  15.         Case 32, 45, 46, 48 To 58, 65 To 90, 97 To 122 '<space>azAZ09.-:
    
  16.             TInput += Chr(TKey1)
    
  17.     End Select
    
  18.     Screenlock()
    
  19.     Cls()
    
  20.     Draw String (10, 10), "Eingabe: " & TInput, &HFFFFFF
    
  21.     Screenunlock()
    
  22.     Sleep 1, 1
    
  23. Loop
    
  24. Screen 0
    
  25. Print TInput
    
  26. End 0