Hi Arnaud
I use Select case Asc(Key) instead of comparing against Chr...I have
seen cases where the equality wasnt true
Thanks for this information, I didn't know that.
As I understand, youre trying to only accept roman characters, right?
Right !
Why do you handle the chr(9) like this?
Nothing to do with filtering characters. I just want to be sure that Tab
will give focus to the specified field.
(and dont forger if the user is actually typing Shift-Tab to move the
focus to the previous field!)
And, of course, I forgot it! Thanks for pointing that. Actually, the
case Is>=Chr(32) lets the Shift-Tab works properly.
Also, Is>=Chr(32) is redundant with Chr(13) and chr(3) returning
false. Im just saying that to improve the piece of code above.
I don't think so. It's the part of the filter that deal with any other
character except those previously filtered. It could be replaced par the
'Else' part of the Select Case test. This lets the TextField not
accepting any character >=Chr(32), but working as usual for the others,
like arrows, Shift-Tab, ...
Jean-Luc Arnaud
Le 18 août 2017 à 18:17 du soir, Jean-Luc Arnaud
Post by Jean-Luc ArnaudSelect Case Key
Case "I","V","X","L","C","D","M", Chr(13), Chr(3), Chr(127)
Return False
Case Chr(9)
Décimal_TextField.SetFocus
Return True
Case Is>=Chr(32)
Return True
End Select
This matches exactly my need (except for Drag/Drop and Paste).
I usually do something like that. The notable difference being I use
Select case Asc(Key) instead of comparing against Chr (this is the
other way around, but I do like that because the language reference
state that Chr returns character as ASCII values and I have seen cases
where the equality wasnt true).
As I understand, youre trying to only accept roman characters, right?
Why do you handle the chr(9) like this? The tab key should just work
if you return false (and dont forger if the user is actually typing
Shift-Tab to move the focus to the previous field!)
Also, Is>=Chr(32) is redundant with Chr(13) and chr(3) returning
false. Im just saying that to improve the piece of code above.
Regards
To unsubscribe, email ***@xojo.com