Checks if one char is within two ASCII codes or not (StringASCIIs)
Used to see if languages other than English is found, above 128, like Arabic language
Function StringASCIIs(StrText, ASCII1, ASCII2)
' See if all chars in StrText are between ASCII1 and ASCII2
' Returns 0 if none found, returns number of chars if any found
Fou1 = 0
For I = 1 To Len(StrText)
If AscW(Mid(StrText, I, 1)) < ASCII1 Or AscW(Mid(StrText, I, 1)) > ASCII2 Then Fou1 = Fou1 + 1
Next
StringASCIIs = Fou1
End Function
Function HaveNonEnglish(StrText)
' Checks if string has char that is not english (ASCII 128 and above)
HaveNonEnglish = StringASCIIs(StrText, 1, 127) > 0
End Function
' See if all chars in StrText are between ASCII1 and ASCII2
' Returns 0 if none found, returns number of chars if any found
Fou1 = 0
For I = 1 To Len(StrText)
If AscW(Mid(StrText, I, 1)) < ASCII1 Or AscW(Mid(StrText, I, 1)) > ASCII2 Then Fou1 = Fou1 + 1
Next
StringASCIIs = Fou1
End Function
Function HaveNonEnglish(StrText)
' Checks if string has char that is not english (ASCII 128 and above)
HaveNonEnglish = StringASCIIs(StrText, 1, 127) > 0
End Function
StrText, ASCII1, ASCII2
Or
StrText
Or
StrText
Views 4,048
Downloads 1,301
CodeID
DB ID
ANmarAmdeen
610
Revisions
v1.0
Sunday
June
17
2018