htmlText oddity

dunbarx at aol.com dunbarx at aol.com
Sun Nov 4 19:32:15 EST 2012


Mark.


I read about "answer" in the dictionary, and found:



The prompt can be either formatted text (in the htmlText property's format) or plain text. If the prompt contains p or a start/end tag pair, the answer command  text is in the same format as the htmlText Property Otherwise, the answer command assumes the text is plain text.


Not sure I fully understand this, but I bet it means I don't have to add a user note to the "answer" entry.


But why only "<p>"? And further, if you substitute "<b>" for ","<p>", the answer command replies faithfully, in spite of the "contains p or a start/end tag pair" comment above, which it seems should include all such constructs, like "<b>". Isn't that a "start/end tag pair?


This is the sort of thing that could drive one nuts trying to clean up persistent errors in code. 


Craig



-----Original Message-----
From: Mark Schonewille <m.schonewille at economy-x-talk.com>
To: How to use LiveCode <use-livecode at lists.runrev.com>
Sent: Sun, Nov 4, 2012 6:31 pm
Subject: Re: htmlText oddity


Hi Craig,

The answer dialog window checks if the text contains html tags (must start with 
<p> and </p>) and if it does, it interprets it as htmlText, which makes the tags 
fo away :-) Try this:

answer "<p><b>This is bold</b><i> and this is italics</i></p>."

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Use Color Converter to convert CMYK, RGB, RAL, XYZ, H.Lab and other colour 
spaces. http://www.color-converter.com

We have time for new software development projects. Contact me for a quote.




On 5 nov 2012, at 00:26, dunbarx at aol.com wrote:

> 
> 
> Make one field and one button. In the field, type a few words, and set the 
textstyle to one of them to "bold".
> 
> 
> In the button:
> 
> 
> on mouseUp
>  get the htmlText of fld 1
>  put it
>  answer it
> end mouseUp
> 
> 
> Where did the tags go? They appear in msg, and if you step through, "it" seems 
fine.
> But what did the "answer" command do to them?
> 
> 
> Craig Newman



_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

 



More information about the use-livecode mailing list