Missing hidden characters and htmlText

Howard Bornstein bornstein at designeq.com
Thu Feb 21 13:47:01 EST 2002


Apparently the conversion to htmltext kills the reference to the "hidden" 
character.

For example, put this in a button:

on mouseup
  put "This is some text" into fld 1
  set the imageSource of char 1 of fld 1 to "arrow"
    
  put the htmlText of fld 1 into lNewText 

  set the htmlText of fld "results" to lNewText
  
  set the imageSource of char 1 of fld 1 to empty
  
  set the imageSource of char 1 of fld "results" to empty
  
end mouseup

The T is restored in fld 1 but is not restored in fld "results". It looks 
like you'll have to keep track of the hidden character yourself and 
restore it manually after an html conversion.

:-(

Howard Bornstein
____________________
D E S I G N  E Q
www.designeq.com


>Try this:
>
>Create a field, put "This is some text" into it
>
>Type:
>
>	set the imageSource of char 1 of fld 1 to "arrow" -- or some id 
>that exists
>
>...we now have "his is some text" with the hidden letter 'T' 'holding' 
>the image, correct?
>
>Create a 2nd field to display some results in.
>
>We can get the full text by typing:
>
>	put the text of fld 1 into fld "results"
>
>... the result is 'This is some text' and we are happy.  For the moment.
>
>Also try:
>
>	put the htmlText of fld 1 into fld  "results"
>
>... and we get:
>
><p><img src="200947">his is some text</p>
>
>PROBLEM occurs when we do something like:
>
>	put the htmlText of fld 1 into lNewText -- pull the html text out 
>for manipulation
>	put lNewText &return& lNewText into lNewText -- manipulate the 
>formatted text
>	set the htmlText of fld 1 to lNewText -- restore the field after 
>manipulation
>
>If we then try:
>
>	put the text of fld 1 into fld  "results"
>
>we get:
>
>his is some text
>his is some text
>
>and the 'T' is gone FOREVER.



More information about the use-livecode mailing list