WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

String Manipulation

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Check Case

Keywords: 	 strings check case

Question:

I cant seem to find a function which will do caps handling(check upper/lower, force upper/lower, etc.). Any recommendations?

Answer:

#definefunction checkcase(character)
  num = char2num(character)
  if num >=97 && num<=122
    retval = 0 ;Lower case
  else
          if num >=65 && num<=90
            retval = 1 ;Upper case
          else
            message("Error Checking Case","%character% is not valid character")
                 exit
          endif
  endif
  return retval
#endfunction

character = "D"
if checkcase(character)
  Message("Character is","Uppercase")
else
  Message("Character is","Lowercase")
endif
Also See the StrUpper and StrLower, to change the case of a string.
Article ID:   W15336
File Created: 2002:09:05:13:51:22
Last Updated: 2002:09:05:13:51:22