scripting challenge: Large/Smaller text size

Malte Brill revolution at derbrill.de
Sat Jul 2 04:54:27 EDT 2005


Hi Richard,

A challenge! Jippieh!!!!

ok, here is my first shot.

Create a text field called "test" , a button for growing the text

Script in the button:

on mouseUp
   put the htmlText of fld 1 into theHtml
   replace "size="&quote with "size="&numtoChar(1500) in theHTML
   set the itemdel to numToChar(1500)
   if the number of items of theHTML<>1 then
     put 0 into itemCount
     repeat for each item theItem in theHTML
       add 1 to itemCount
       if itemCount=1 then
         put theItem into newHTML
         next repeat
       end if
       put 1 into counter
       if ">" is in theItem then
         repeat forever
           add 1 to counter
           if char counter of theItem=quote then exit repeat
         end repeat
         put char 1 to counter-1 of theItem into theSize
         put theSize+1 into theSize
         put theSize into char 1 to counter-1 of theItem
       end if
       put quote&theItem after newHTML
     end repeat
     set the htmlText of fld "test" to newHTML
     set the textSize of fld "test" to the effective textSize of fld 
"test"+1
   end if
end mouseUp

I hope this mail gets through. Still having trouble sending mail to the 
list.

Cheers,

Malte


More information about the use-livecode mailing list