Page 1 of 1

inconsistency with answer and htmlText?

Posted: Mon Nov 05, 2012 12:17 am
by dunbarx
Make a button and a field.

In the field, put a few words, and set the textStyle of one of the words to "bold".
Put this in the button:

Code: Select all

on mouseUp
   get the htmlText of fld 1
   put it
   answer it
end mouseUp
Where did the tags go? They are in msg, and in "it", but not in the answer dialog.

Craig Newman

Re: inconsistency with answer and htmlText?

Posted: Mon Nov 05, 2012 1:35 am
by dunbarx
Me again.

It seems there is a passage in the dictionary that explains this:
Comments:
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 assumes the text is in the same format as the htmlText property. Otherwise, the answer command assumes the text is plain text.
But I still do not see why "<b>" is reproduced faithfully, whereas "<p>" is not, as both are "start/end tag pairs".

Craig Newman