Hi All,
I have been using the text editor to show text formatted in colour. When I save the text, the colour formatting is saved with it and when I load the text back, the formatting is returned as well. However for my purposes colour is just for ease of reading and editing but causes problems with processing the text. Is there a way to remove the formatting code from the text so I can save it without any formatting at all.
I have tried to find the colour format code ( \33P[ff4529] ) using find and replace but it does not find anything, when I look at the text in a hex dump the code is represented as .P[ff4529] can't find that in the text either.
In the TextEditor example in RapaGUI you can change Bold, Italic and Underline but there is nothing to return the code back to normal.
Can anyone set me in the right direction or show me some code that will remove all formatting from the text.
Cheers
Leo
how do I remove Text formatting in TextEditor
how do I remove Text formatting in TextEditor
----------------------------------------------------------------------------------------
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
Re: how do I remove Text formatting in TextEditor
Isnt /33n (text style back to normal) help youon this ?
Christos
Re: how do I remove Text formatting in TextEditor
Hi Christos,
Unfortunately \n does not work as it adds characters into the text and this causes problems.
Cheers
Leo
Unfortunately \n does not work as it adds characters into the text and this causes problems.
Cheers
Leo
----------------------------------------------------------------------------------------
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
Re: how do I remove Text formatting in TextEditor
when searching with strings use \27
here is an example that removes bold start and end in text
edit
also about your question of TextEditor in examples, the example uses unmidstr and removes these escape characters from text
as an extra note/idea if you dont need editing, you may consider htmlview, where html/xml files are easier to manipulate
here is an example that removes bold start and end in text
Code: Select all
fl$ = FileToString("c:\\test.txt")
DebugPrint(fl$)
fl$ = ReplaceStr(fl$,"\27b","") ; no BOLD entry (\33b)
DebugPrint(fl$)
fl$ = ReplaceStr(fl$,"\27n","") ; no back to normal (\33n)
also about your question of TextEditor in examples, the example uses unmidstr and removes these escape characters from text
as an extra note/idea if you dont need editing, you may consider htmlview, where html/xml files are easier to manipulate
Christos
Re: how do I remove Text formatting in TextEditor
Hi Christos,
Sorted now, thanks for the info it was the UnmidStr() that was what I needed, ReplaceStr() did not seem to work - not sure why.
Thanks again for your help.
Cheers
Leo
Sorted now, thanks for the info it was the UnmidStr() that was what I needed, ReplaceStr() did not seem to work - not sure why.
Thanks again for your help.
Cheers
Leo
----------------------------------------------------------------------------------------
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32