New topic: 

How to get styledtext from textareas to one with new line?

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

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        tadicboris          Post subject: How to get styledtext from 
textareas to one with new line?Posted: Wed Apr 10, 2013 5:47 am                 
        
Joined: Fri Nov 25, 2011 3:14 am
Posts: 24
Location: Serbia                I have four text areas where my user enter 
textual data.
TextArea1,TextArea2,TextArea3, and TextArea4.

I dont know how to "copy" text from all of them in textarea5 with all syles 
preserved (bold, italis etc..) and with "endofline" between them.

I tried textarea5.styledtext.rtfdata = textarea1.styledtext.rtfdata + endofline 
+ textarea2.styledtext.rtfdata + endofline + textarea3.styledtext.rtfdata+ 
endofline + textarea4.styledtext.rtfdata

I cant get new lines (endofline) in  textarea5?  When I try to programaticaly 
add some text it looses syles ( textarea1.text + "some text"). I tried to 
resolve problem with styleruns but without success.      
_________________
Dr Boris Tadić
Medical Software Development
www.digitsoft.rs  
                             Top                DaveS          Post subject: 
Re: How to get styledtext from textareas to one with new linPosted: Wed Apr 10, 
2013 8:46 am                                 
Joined: Sun Aug 05, 2007 10:46 am
Posts: 4737
Location: San Diego, CA                This seems to work

dim i as integer
dim j as integer
dim start as integer
dim st as StyledText
for i=1 to 4
  select case i
  case 1
  st=textarea1.styledtext
  case 2
  st=textarea2.styledtext
  case 3
  st=TextArea3.styledtext
  case 4
  st=TextArea4.styledtext
  end select
  //
  For j=0 To st.StyleRunCount-1
  start=textarea5.selstart
  msgbox str(start)
  textarea5.seltext=st.text
  textarea5.selstart=start
  textarea5.sellength=len(st.text)
  '
  textarea5.SelTextFont=st.StyleRun(j).Font
  textarea5.SelBold=st.StyleRun(j).Bold
  textarea5.selItalic=st.StyleRun(j).Italic
  textarea5.SelTextColor=st.StyleRun(j).TextColor
  textarea5.SelUnderline=st.StyleRun(j).Underline
  textarea5.SelTextSize=st.StyleRun(j).Size
  textarea5.selstart=textarea5.SelStart+textarea5.SelLength
  Next j
  
next i


I would however suggest converting TextArea1-5 to a control array....      
_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
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