Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Josh Chunick's Personal Site
Advance counter v20040306
cXtraStringGrid
Flashation Flash Menu Builder
Pretty Script
Detecting Quicktime
Ripple Button-Alphamania
cXtraDateTimePicker
Invaders
Exit Windows
 

 

 

Behavior convert to upper or to lowercase

Added on 12/21/2004

 

Compatibilities:
D6_5 D7 D8 D8_5 D9 Shockwave

This item has not yet been rated

Author: Roti (website)

This functions will convert any string to upper or lower case. It can contains accent marked characters too. example: put str_to_uppercase ("sfdő_- .adfkjbvélsaekjv éowi eruzgőq34zuf -'+!UG !GU !TOGBU!TÉBUVŐ") -- "SFDŐ_- .ADFKJBVÉLSAEKJV ÉOWI ERUZGŐQ34ZUF -'+!UG !GU !TOGBU!TÉBUVŐ" put str_to_lowercase ("sfdő_- .adfkjbvélsaekjv éowi eruzgőq34zuf -'+!UG !GU !TOGBU!TÉBUVŐ") -- "sfdő_- .adfkjbvélsaekjv éowi eruzgőq34zuf -'+!ug !gu !togbu!tébuvő"

---------------------------------------------------------------
on str_to_uppercase str
  repeat with i=1 to str.length
    str_num=chartonum(str.char[i])
    upper_num=chartonum(str.char[i])-32
    if numtochar(str_num)=numtochar(upper_num) then
      uppered=uppered&numtochar(upper_num)
    else
      uppered=uppered&numtochar(str_num)
    end if
  end repeat
  return uppered
end
---------------------------------------------------------------
on str_to_lowercase str
  repeat with i=1 to str.length
    str_num=chartonum(str.char[i])
    lower_num=chartonum(str.char[i])+32
    if numtochar(str_num)=numtochar(lower_num) then
      lowered=lowered&numtochar(lower_num)
    else
      lowered=lowered&numtochar(str_num)
    end if
  end repeat
  return lowered
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail