On 9/20/20 9:28 AM, Sannyasin Brahmanathaswami via use-livecode wrote:
Eureka! So easy, now to get back to the htmlText as per the code
if the htmlText of field "mainText" then
put the htmlText of field "mainText" into field "mainText"
else
set the htmlText of field "mainText" to field "mainText"
end if
we wonder how easy it to tell that "if" the clause is telling it is "true"
if (set the htmlText of field "mainText" to field "mainText") then
does not work
Typically you can check the field text for a known html entity to see if it contains html or
not. I think LC uses "<p>" because almost all html includes a paragraph mark.
if "<p>" is in field "mainText" then -- htmltext is there
If your html doesn't have paragraph entities then see if you can find one that you know will be
there.
As an aside, I first thought that this would work:
if the htmltext of field "mainText" <> the text of field "mainText" then -- plain text is in
the field
which does return "false" correctly. But when I set the text of the field to the htmltext of
the field and run the same test, it also returns "false". I'm not sure why.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode