Devin Asay wrote:
> On Jul 8, 2015, at 11:24 AM, Gregory Lypny wrote:
>>
>> I imported an RTF file and put it into a field using
>>
>>   set the RTFText of field "File Text" to url ("file:" &
>> longFileName)
>>
>> Of course, the text in the field is formatted as in the file that
>> was imported. How can I import the text while stripping away the
>> formatting, which I do not need?
>
> Just ‘put’ the text of the field into another field or variable:
>
>   put fld “myRTF” into fld “myText”
>
> Putting text never preserves formatting.
>
> Another trick I’ve learned (unless it’s been changed recently) is
> that using ‘replace’ on a field strips formatting.
>
>   replace space with space in fld “myRTF”

Setting the field's contents as with your first example would be the way I would recommend.

Replacing a single character should ideally only affect the text style for that character, even if it occurs in multiple places, so personally I would consider the second example a bug if it strips all styles from unaffected portions of the text.

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 ____________________________________________________________________
 ambassa...@fourthworld.com                http://www.FourthWorld.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

Reply via email to