Missing hidden characters and htmlText

Matt Denton matt.denton at limelight.com.au
Thu Feb 21 11:45:01 EST 2002


On Wednesday, February 20, 2002, at 06:50  PM, "Jeanne A. E. DeVoto" 
<jeanne at runrev.com> wrote:

> At 12:18 AM -0800 2/19/2002, Matt Denton wrote:
>> I can't find a way to keep the 'hidden' character of a field that has
>> the imageSource set for it.
>
> I think you'll find this is fixed in 1.1.1b1. (The hidden character, in 
> the
> htmlText, is replaced by a tag of the form <img src="imageSource 
> here">.)

Thanks for your help but...

Do you mean the 1.1.1b1 I'm running now?  The problem still exists, any 
operations performed on the  htmlText of a field destroy the character 
behind the imageSource.

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.  I've tried every variation I can think of 
to try and 'keep' the hidden 'graphic' character when manipulating 
formatted HTML text in and out of a field.  No luck.  In theory using a 
repeat loop could gobble up every char in your field.

Anyone know how I can solve this problem?

SUGGESTION: perhaps the htmlText could have an additional 'alt text' 
tag, similar to HTML holding the 'hidden' character that would be 
persistent when restoring the character after performing manipulations 
on the htmlText property.

Otherwise I'm at a loss.

Thanks for any and all suggestions,

Cheers,


M@
Matt Denton










More information about the use-livecode mailing list