Instead of toUpper

Eric Chatonet eric.chatonet at sosmartsoftware.com
Sat Nov 29 08:37:40 EST 2008


Bonjour Ton,

Why Rev toUpper built-in function does not work for you?

Le 29 nov. 08 à 14:33, Melitón Cardona Torres a écrit :

> Works fine on my mac; I wonder whether it be the same a PC. Any hints?
>
> Thanks in advance,
>
> Ton Cardona
>
> function toCapitals aText
>  --Works on a mac environement
>
>   put "ÁÉÍÓÚÑÄËÏÖÜÂÊÎÔÛÇÆØŒÅ" into unusualCapitals
>   put "áéíóúñäëïöüâêîôûçæøœå" into unusualSmall
>
>   repeat with y= 1 to the length of aText
>     put char y of aText into aChar
>     put chartonum(aChar) into itsNumber
>
>     --Line feed
>     if itsNumber = 10 then
>       put cr after newWord
>       next repeat
>     end if
>
>     --Already capital
>     if itsNumber>64 and itsNumber<91 then
>       put aChar after newWord
>       next repeat
>     end if
>
>     -- Not capital without accent
>     if itsNumber >96 and itsNumber <123 then
>       put numtochar(itsNumber-32) after newWord
>       next repeat
>     end if
>
>     -- Foreseen unusual characters
>     if aChar is among the chars of unusualSmall then
>       put false into detected
>       repeat with g= 1 to 22
>         if char g of unusualSmall is aChar then
>           put char g of unusualCapitals after newWord
>           put true into detected
>           exit repeat
>         end if
>       end repeat
>       if detected then next repeat
>     end if
>
>     --Space, numbers and others
>     if ((itsNumber >31) and (itsNumber <65)) or ((itsNumber>90) and  
> (itsNumber<97)) then
>       put aChar after newWord
>       next repeat
>     end if
>
>     --Unforeseen unusual characters
>     if itsNumber>122 and aChar is not in unusualSmall then
>       put aChar after newWord
>       next repeat
>     end if
>   end repeat
>
>   return newWord


Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------





More information about the use-livecode mailing list