I don't know why it's picking the wrong line, but the error is happening in the line that checks ELSEIF ASC(char) = 8 THEN. ASC will fail if the string passed to it is empty, which will happen immediately in your code because char = INKEY$ and when the procedure is started, no key has been pressed yet. Use this change instead:Code: QB64: [Select]
Const qbCHARS = "12345d67890-=qwertyuiop[]asdfghjkl;#\zxcvbnm,./QWERTYUIOPASDFGHJKLZXCVBNM!$%^&*()_+{}:@~|<>? " test = TextInputBox(200, 200, "some text", "") chg = 0 char = InKey$ chg = 1 YesNoBox = char YesNoBox = "" chg = 1 chg = 0 charCount = 1 chg = 0 TextInputBox = defaultInput char = InKey$ TextInputBox = TextInputBox + char chg = 1 chg = 1 chg = 0