gettingstarted
[Top] [All Lists]

Re: How Can I Save the plain ASCII version of Formatted Text?

To: <gettingstarted at lists dot realsoftware dot com>
Subject: Re: How Can I Save the plain ASCII version of Formatted Text?
From: "B Traver" <btraver at traver dot org>
Date: Thu, 23 Sep 2004 23:32:51 -0400
Delivered-to: gettingstarted at lists dot realsoftware dot com
Importance: Normal
Seth,

> EditField.Text gives you the style data too?

Your note prompted me to do some additional testing, and with some
carefully placed breakpoints I discovered that the line being executed
to save the file was not the line I thought was being executed, so
there's no problem after all (except with my own code). 
 
Here's what I thought I had written:

        If (FileExtension = ".txt") or (FileExtension = ".htm") or
(FileExtension = ".html") Then 
          Filestream = f.CreateTextFile
          Filestream.Write Textfield.Text
          Filestream.close
        Else
          Document.SaveStyledEditField TextField 
        End If

And here's what I had actually written:

        If (FileExtension = "txt") or (FileExtension = ".htm") or
(FileExtension = ".html") Then 
          Filestream = f.CreateTextFile
          Filestream.Write Textfield.Text
          Filestream.close
        Else
          Document.SaveStyledEditField TextField 
        End If

Notice the difference?  (I didn't.)  So when it came to saving Test.txt,
the line that actually saved the file (contrary to my assumption) was
not this:

        Filestream.Write Textfield.Text

But this:

        Document.SaveStyledEditField TextField 

So Of course the file saved was in Rich Text Format.

Sorry for the false alarm.  But it leads me to ask a different question.
Since EditField.Text does in fact supply the plain text wihout the
formatting information, is there a way to access the version that
includes the formatting information (without actually writing it to disk
and then reading it from disk)?

Barry Traver

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>