J js486dog Active Member Licensed User Longtime User Sep 18, 2019 #1 I need to open and read txt files. I can use EditText or BBCodeView. I think there is some disadvantage for BBCodeView: TXT files has to be as has to be for BBCodeView. EditText is more freely for content of files. Look: from1.txt - bad file for BBCodeView. from2.txt - good file for BBCodeView. Look also attached project. Attachments from1.txt 93 bytes · Views: 182 from2.txt 82 bytes · Views: 198 JustifyEx_BBCV.zip 9.7 KB · Views: 186
I need to open and read txt files. I can use EditText or BBCodeView. I think there is some disadvantage for BBCodeView: TXT files has to be as has to be for BBCodeView. EditText is more freely for content of files. Look: from1.txt - bad file for BBCodeView. from2.txt - good file for BBCodeView. Look also attached project.
Erel B4X founder Staff member Licensed User Longtime User Sep 18, 2019 #2 The question is not clear. I guess that you are having problems from non-tag brackets. You can wrap the text with the plain tag and it will not be parsed. Upvote 0
The question is not clear. I guess that you are having problems from non-tag brackets. You can wrap the text with the plain tag and it will not be parsed.
E emexes Expert Licensed User Sep 18, 2019 #3 Erel said: You can wrap the text with the plain tag and it will not be parsed. Click to expand... Eg, read file from1.txt into a string, and then add the tags like: B4X: Dim PlainString As String = "[PLAIN]" & WholeFileString & "[/PLAIN]" so that PlainString would then be: [PLAIN]EditText works fine with this text and text […] as this. But BBCodeView has problem.[/PLAIN] Upvote 0
Erel said: You can wrap the text with the plain tag and it will not be parsed. Click to expand... Eg, read file from1.txt into a string, and then add the tags like: B4X: Dim PlainString As String = "[PLAIN]" & WholeFileString & "[/PLAIN]" so that PlainString would then be: [PLAIN]EditText works fine with this text and text […] as this. But BBCodeView has problem.[/PLAIN]
J js486dog Active Member Licensed User Longtime User Sep 18, 2019 #4 emexes said: Eg, read file from1.txt into a string, and then add the tags like: B4X: Dim PlainString As String = "[PLAIN]" & WholeFileString & "[/PLAIN]" so that PlainString would then be: [PLAIN]EditText works fine with this text and text […] as this. But BBCodeView has problem.[/PLAIN] Click to expand... Thank you very much "emexes". That's right. This code read txt files as plain files - not as code files. I think I have to correct my first post about the disadvantage for BBCodeView. Upvote 0
emexes said: Eg, read file from1.txt into a string, and then add the tags like: B4X: Dim PlainString As String = "[PLAIN]" & WholeFileString & "[/PLAIN]" so that PlainString would then be: [PLAIN]EditText works fine with this text and text […] as this. But BBCodeView has problem.[/PLAIN] Click to expand... Thank you very much "emexes". That's right. This code read txt files as plain files - not as code files. I think I have to correct my first post about the disadvantage for BBCodeView.