Problem with setting htmlText of field to empty in LiveCode 6.6 RC2

Tim Bleiler bleiler at buffalo.edu
Wed Mar 19 15:14:15 EDT 2014


On Mar 19, 2014, at 2:36 PM, Scott Rossi wrote:

> Maybe it helps (or hinders) to consider the fact the following renders as
> empty in a web browser, even though clearly there is code content present:
> 
> <html>
> <body>
> </body>
> </html>
> 
> So given what HTML is, checking if the HTML content of a field is empty
> doesn't really compare to checking if the code content of a field is empty.


On Mar 19, 2014, at 2:45 PM, Peter Haworth wrote:

> If the current behavior was changed, I'm sure it would cause backward
> compatibility problems.
> 
> If you want to check if a field is empty - if field "myField" is empty -
> works fine as does - if the text of field "myField" is empty


I think these views are correct. The fact that the htmlText is never really empty may not be as inconsistent as it seems at first. Many properties have ranges of specific values and if you try to set them to something outside of those ranges, the engine often throws an error. The engine is just being kind when it allows us to Set the htmlText of fld "My field" to empty, since this is apparently not technically valid. 

I agree with Peter that a change at this point would likely cause far more problems than it's worth. 

> I'm not sure why this is such a problem.  Html isn't regular text and
> shouldn't be treated as such, that's why htmltext is a separate property
> from text.


Yes, I think this is the key take home point of the discussion.

Tim






More information about the use-livecode mailing list