Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Do
  2.     PrintString (23, 1, "What do you do?")
  3.     PrintString (24, 1, ">")
  4.     Do
  5.         KeyHit = InKey: If Len(KeyHit)=0 Then Sleep 5,1: Continue Do
  6.        
  7.         var iKey = cint(KeyHit[0])
  8.         If iKey = 255 then iKey = -KeyHit[1]
  9.  
  10.         Select Case iKey
  11.         Case 3  'Ctrl+C
  12.             End
  13.         Case 13, -FB.SC_DOWN
  14.             Exit Do
  15.         Case 32 to 127
  16.             'If iKey = 8 Then
  17.             If iKey or iKey = -FB.SC_LEFT Then
  18.                 If Len(UserInput) Then
  19.                     cptr(uLong ptr, @UserInput)[1] -= 1 'Remove last char
  20.                     screensync  'Wait for VSYNC
  21.                     PrintString(23, 1, Space(SCREEN_WIDTH-2))
  22.                     PrintString(24, 1, Space(SCREEN_WIDTH-2))
  23.                     PrintString(24, 1, ">")
  24.                 End If
  25.             Else
  26.                 If Len(UserInput) < 44 Then UserInput += KeyHit
  27.                 PrintString 24, 2, UserInput
  28.             End If
  29.         End Select
  30.     Loop
  31.    
  32. Loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement