[Gambas-bugtracker] Bug #1721: TRY doesn't silence the error
bugtracker at gambaswiki.org
bugtracker at gambaswiki.org
Sun Feb 2 17:48:46 CET 2020
http://gambaswiki.org/bugtracker/edit?object=BUG.1721&from=L21haW4-
Comment #6 by Gianluigi GRADASCHI:
Thank you very much, so staying with the project, this code should work:
Public Sub TextArea1_KeyPress()
Dim s As String
Dim ss As String[]
Dim iStart, iMinus As Integer
If Key.Code = Key["V"] And If Key.Control Then
Stop Event
s = Clipboard.Paste("text/plain;charset=utf-8")
If Not s Then s = Clipboard.Paste()
For i As Integer = 0 To Len(s)
If s[i] = "\n" Then Continue
If Asc(s[i]) = 0 Then Continue
If Asc(s[i]) < 32 Then Inc iMinus
Next
iStart = String.Len(TextArea1.Text)
TextArea1.Text &= s
TextArea1.Select(iStart, String.Len(s) - iMinus)
Endif
Catch
Print Error.Text
End
More information about the Bugtracker
mailing list