by Alex Bylund (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (2 Votes)
Checks to make sure the contents of a TextBox or String are only standard ASCII; If it has any extended ASCII, the function will return False.
Assumes
Use like this:
If Valid_ASCII(Text1) = False Then
MsgBox "Invalid chars!"
Exit sub
End If
Function Valid_ASCII(Text As String)
For x = 1 To Len(Text)
If Asc(Mid(Text, x, 1)) > 126 Or Asc(Mid(Text, x, 1)) < 32 Then
Valid_ASCII = False
Exit Function
End If
Next x
Valid_ASCII = True
End Function