New topic: 

replacing \r with a newline in the IDE

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

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        BodoniSystems          Post subject: replacing \r with a newline 
in the IDEPosted: Thu Jan 03, 2013 7:11 am                         
Joined: Tue Jan 30, 2007 10:44 am
Posts: 49                Hi,

I have some constants which come back in after translating with a \r instead of 
a newline, so I'd like to replace them with a newline

I tried a Regex search in the IDE and found them all, but could not replace 
them with a new line character

I used this pattern: \\r

This found all the correct matches, but when replacing with \n the string gets 
corrupted.

For the moment I've replaced them manually, but I know will get this problem 
again.

I have a function which can strip them at runtime for some of the strings, but 
many are just #constant_name which does not replace them.

Thanks

Lee Badham   
                             Top                Thom McGrath          Post 
subject: Re: replacing \r with a newline in the IDEPosted: Thu Jan 03, 2013 
9:02 am                       Site Admin                
Joined: Tue May 06, 2008 1:07 pm
Posts: 1318
Location: Greater Hartford Area, CT                
ReplaceAll(Source,Chr(13),Chr(10))      
_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.  
                             Top                BodoniSystems          Post 
subject: Re: replacing \r with a newline in the IDEPosted: Thu Jan 03, 2013 
9:18 am                         
Joined: Tue Jan 30, 2007 10:44 am
Posts: 49                Thanks for the reply, but that's not what I'm after.

That's what I use at runtime, but I need something which I can replace he 
values in constants so the #constant tag works in static text.

I'm using the Regex find inside the IDE


I'd like to know what to replace the //r with to get newlines

Lee   
                             Top                Thom McGrath          Post 
subject: Re: replacing \r with a newline in the IDEPosted: Thu Jan 03, 2013 
9:32 am                       Site Admin                
Joined: Tue May 06, 2008 1:07 pm
Posts: 1318
Location: Greater Hartford Area, CT                Ah. I'd use a text editor. 
Copy and paste the characters. The fields will look empty, but it'll work. Or 
just write a small program you can copy/paste the actual content between that 
will do the swap for you.      
_________________
Thom McGrath - @tekcor
Web Framework Architect, Real Software, Inc.  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 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