VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Check for extended ASCII

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

Rate Check for extended ASCII

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

Download this snippet    Add to My Saved Code

Check for extended ASCII Comments

No comments have been posted about Check for extended ASCII. Why not be the first to post a comment about Check for extended ASCII.

Post your comment

Subject:
Message:
0/1000 characters