Android Question Trouble with Chars in Text File

mw71

Active Member
Licensed User
Longtime User
hi,

i generate a Text File, Part of Code:
B4X:
    Dim tmpString(7) As String
    tmpString(0)= "|                                                                                                       "
    tmpString(1)= "|Berg                                                                                                   "
    tmpString(2)= "+-----+-----+-----+-----"
    tmpString(3) ="|2m   |70cm |23cm |13cm "
    tmpString(4) ="|T |B |T |B |T |B |T |B "
    tmpString(5)= "+--+--+--+--+--+--+--+--"
    tmpString(6)= "+--------------------------------------------------------------------------------------------------------"

    SBA.append(tmpString(6).substring2(0,varLenMax(0)+1)).append(tmpString(2))
    SBA.append(tmpString(6).substring2(0,varLenMax(1)+1)).append(tmpString(2))
    SBA.append(tmpString(6).substring2(0,varLenMax(2)+1)).append(tmpString(2)).append("+").append(CRLF)

    SBA.append(tmpString(0).substring2(0,varLenMax(0)+1)).append(tmpString(3))
    SBA.append(tmpString(0).substring2(0,varLenMax(1)+1)).append(tmpString(3))
    SBA.append(tmpString(0).substring2(0,varLenMax(2)+1)).append(tmpString(3)).append("|").append(CRLF)

    SBA.append(tmpString(1).substring2(0,varLenMax(0)+1)).append(tmpString(4))
    SBA.append(tmpString(1).substring2(0,varLenMax(1)+1)).append(tmpString(4))
    SBA.append(tmpString(1).substring2(0,varLenMax(2)+1)).append(tmpString(4)).append("|").append(CRLF)

    SBA.append(tmpString(6).substring2(0,varLenMax(0)+1)).append(tmpString(5))
    SBA.append(tmpString(6).substring2(0,varLenMax(1)+1)).append(tmpString(5))
    SBA.append(tmpString(6).substring2(0,varLenMax(2)+1)).append(tmpString(5)).append("+").append(CRLF)

- in Notepad++ (at PC) all looks fine
- with Total Commander e.g., on Smartphone, each Char have a different Size so that the | and + not one above the other

What can i do to get the Chars one above the other?
 

RichardN

Well-Known Member
Licensed User
Longtime User
You have to use a monospaced font where all characters are of equal width. It is not the most elegant presentation but unless you go for some other tabular format then your choices are very limited with pure text.
 
Upvote 0

mw71

Active Member
Licensed User
Longtime User
thanks for the explanation.
now i generate an second File, HTML, works fine.

thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…