function toCapitals aText
  put "ÃÁÀÂÉÈÊËÍÎÏÌÑÓÒÔÖÕÚÙÛÜÇÅØ" into spCap
  put "äáàâéèêëíîïìñóòôöõúùûüçåø" into spSma
if chartonum(char 2 of aText)>64 and chartonum(last char of aText)<91 then
   ## No need to process, apparently
    return aText
  else
    put toUpper(aText) into upText
    repeat with x = 1 to the number of chars of upText
      put char x of upText into aChar
## Those characters (æ, œ) cannot be included in spSma (?)
      if chartonum(aChar) is 190 then
        replace aChar with numtochar(174) in upText
        next repeat
      end if
     if chartonum(aChar) is 207 then
        replace aChar with numtochar(207) in upText
        next repeat
      end if
## SpecChars
     if aChar is among the chars of spSma then
        repeat with y=1 to the number of chars of spSma
          if aChar is char y of spSma then
            replace char y of spSma with char y of spCap in upText
          end if
        end repeat
      end if
    end repeat
  end if
  return upText
end toCapitals

Based on Robert Brenstein's 
suggestions._______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to