upperCase to lowerCase

Ken Norris (dialup) pixelbird at interisland.net
Mon Jan 14 23:27:00 EST 2002


on 1/14/02 7:33 AM, Rolf Kocherhans at rolfk at vetvir.unizh.ch wrote:

> Can anyone help me to rewrite the function below so that it changes
> upperCase to lowerCase.
> 
> 
> This Function changes lowerCase to upperCase:
> 
> function upperCase whatStr
> repeat with charNum = 1 to the number of chars in whatStr
> put charToNum(char charNum of whatStr) into thisChar
> if thisChar >= 97 AND thisChar <= 122
> then put numToChar(thisChar - 32) into char charNum of whatStr
> end repeat
> return whatStr
> end upperCase
----------
Maybe I don't understand the question, but its just reversed, starting with
the upper case char numbers and add 32.

function upperCase whatStr
   repeat with charNum = 1 to the number of chars in whatStr
     put charToNum(char charNum of whatStr) into thisChar
     if thisChar >= 65 AND thisChar <= 90
     then put numToChar(thisChar + 32) into char charNum of whatStr
   end repeat
   return whatStr
end upperCase




More information about the use-livecode mailing list