New topic: 

Problem with StyledText from Plain Text???

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

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        simulanics          Post subject: Problem with StyledText from 
Plain Text???Posted: Tue Feb 26, 2013 2:59 am                                 
Joined: Sun Aug 12, 2007 10:10 am
Posts: 990
Location: Boiling Springs, SC                I have decided to convert a 
textarea to use styledtext...from a new document I can add styled elements and 
save them using 

write textarea.styledtext.rtfdata

and I can load the styledtext back into a textarea from the saved data...

Here is the dilemma... before styled text was implemented, files were saved as 
plain text...so if I try the following 'pseudo-code' it loads the plain text, 
but the textarea itself remains empty.

Dim x as string = "This is plain text from the file"
textarea.styledtext.rtfdata = x

The above renders an empty textarea....

So, what's the best method to to check if the text is actually styled text so 
that I could implement something like:

Dim x as string = "This is plain text from the file"
if TextIsStyled(x) = True then
  textarea.styledtext.rtfdata = x
else
 textarea.text = x
end if

and from there I can use the save method (write textarea.styledtext.rtfdata) to 
force opened text files from the old versions to the new "styledtext" format.   
   
_________________
Matthew A. Combatti
Real Studio 2012 r1.2
Visit Real Studio Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8 Beta
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS
~All REAL Compatible~  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
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