New topic: 

Readinfg rtf file

<http://forums.realsoftware.com/viewtopic.php?t=47396>

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        f_hendriksen          Post subject: Readinfg rtf filePosted: Mon 
Mar 25, 2013 6:02 am                         
Joined: Fri Sep 18, 2009 8:09 am
Posts: 101
Location: Netherlands                I'm using the following code to save to 
rtf:
Dim f as FolderItem=GetSaveFolderItem(TextTypes.TextRtf,"TestSaveRTF.rtf")
If f <> nil then
  Dim s as TextOutputStream=TextOutputStream.Create(f)
  s.Write TextArea1.StyledText.RTFData
  s = nil
End if


When I check with Libreofoffice there is content in the file.

Now when I try to read the file the textarea is empty.
I'm using this code:
Dim f as FolderItem
f=GetOpenFolderItem(TextTypes.TextTypes.Textrtf)
If f <> Nil Then
  Dim tis As TextInputStream
  tis = TextInputStream.Open(f)
  TextArea1.StyledText.RTFData = tis.ReadAll
  tis.Close
End if
   
                             Top                DaveS          Post subject: 
Re: Readinfg rtf filePosted: Mon Mar 25, 2013 8:22 am                           
      
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4697
Location: San Diego, CA                I cut/pasted you code... 

only made one change (just to speed testing)

dim f as FolderItem
f=SpecialFolder.Desktop.child("x.rtf")


and it worked just fine      
_________________
Dave Sisemore
MacPro, OSX Lion 10.7.4 RB2012r1
Note : I am not  interested in any solutions that involve custom Plug-ins of 
any kind  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to