anandknr
Member
Hi All,
Just want to confirm if any inbuilt function (or a better version of user function) available for below tasks.
2. Check if a given word is alpha numeric or not
Just want to confirm if any inbuilt function (or a better version of user function) available for below tasks.
- Check is a given word is in UPPER case or not?
Code:
function checkIfUpperCase returns logical (input inputString as character):
define variable isInUpper as logical no-undo.
isInUpper = (encode(inputString) = encode(UPPER(inputString))).
return isInUpper.
end function.
2. Check if a given word is alpha numeric or not
Code:
function VerifAlphaNum returns logical
(input pcString as character):
define variable splChar as logical no-undo.
define variable iPos as integer.
define variable iAsc as integer.
splChar = true.
do iPos = 1 to length(pcString):
iAsc = asc(substring(pcString, iPos, 1)).
if (iAsc < 48) or (iAsc > 58 and iAsc < 65)
or (iAsc > 90 and iAsc < 97) then
do:
splChar = false.
leave.
end.
end.
return (splChar).
end function.