KB-41359: Special characters in the setpoint.

Question:

How can I keep the user from typing special characters in a setpoint ?

Solution:

To do so, you must add the following script to Setpoint’s Validate event:

N = Len(NewValue)  ‘Returns to N the number of characters in the word
For i=1 to N  ‘Loops until N’s value
  Letter = Asc(Mid(NewValue, i, 1))  ‘Turns the letter selected by Mid into an ASCII value
  If (Letter>=65 AND Letter <=90) OR (Letter >=97 AND Letter <=122) OR (Letter>=48 AND  Letter  <=57) Then
  Else
    MsgBox “ERROR in character: ” & i & ” Letter: ” & Chr(Letter)
  End if
Next

For further information, please refer to VBScript’s reference guide, as well as the application below.

 

Attachments:

AppExemplo

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Deixe seu Comentário

Seu endereço de e-mail não será publicado. Campos marcados com asterisco são obrigatórios *