January 1, 2005

WinTask - CheckCharForAlpha

'
' Check Char for Alpha
'
' Author: Joe Strazzere
'

'String @s='Q'     # the character to check
'Integer @i=Asc(@s)
'
'DLLRegisterFunction(user32.dll,IsCharAlphaA,IsAlpha,AI)
'DLLRegisterFunction(user32.dll,IsCharAlphaNumericA,IsAlphaNumeric,AI)
'DLLRegisterFunction(user32.dll,IsCharUpperA,IsUpper,AI)
'DLLRegisterFunction(user32.dll,IsCharLowerA,IsLower,AI)
'
'Echo "The character is:",@s,"ASCII value:",@i
'Echo "  Alphabetic  = ",IsAlpha(@i)
'Echo "  Alphnumeric = ",IsAlphaNumeric(@i)
'Echo "  UpperCase   = ",IsUpper(@i)
'Echo "  LowerCase   = ",IsLower(@i)
test$="ß"
'test$="`"
' Check if character is Alpha
' 1=Alpha 0=Not
ret=External("user32","IsCharAlphaA",Asc(test$))
if ret=1 then
  msgbox(test$+" IS Alpha")
else
  msgbox(test$+" is NOT Alpha")
endif
' Check if character is AlphaNumeric
' 1=AlphaNumeric 0=Not
ret=External("user32","IsCharAlphaNumericA",Asc(test$))
if ret=1 then
  msgbox(test$+" IS AlphaNumeric")
else
  msgbox(test$+" is NOT AlphaNumeric")
endif
' Check if character is Uppercase
' 1=Uppercase 0=Not
ret=External("user32","IsCharUpperA",Asc(test$))
if ret=1 then
  msgbox(test$+" IS Uppercase")
else
  msgbox(test$+" is NOT Uppercase")
endif
' Check if character is Lowercase
' 1=Uppercase 0=Not
ret=External("user32","IsCharLowerA",Asc(test$))
if ret=1 then
  msgbox(test$+" IS Lowercase")
else
  msgbox(test$+" is NOT Lowercase")
endif