Tabbed Text

Blitz3D Forums/Blitz3D Beginners Area/Tabbed Text

_PJ_(Posted 2003) [#1]
using the Text command, is it possible to tabulate to arrange the text?

I tried
 Text x,y,"Column 1"+Chr$(9)+"Column2"


But it didnt work...


patisawesome(Posted 2003) [#2]
what does tabulate mean?


Perturbatio(Posted 2003) [#3]
Tabulate: To put in tabular form (list systematically).

If you are using a fixed-width font then you could use spaces.

i.e. tab$="     "

Text x,y,"Column 1"+tab$+"Column2"



GfK(Posted 2003) [#4]
Perturbatio - that still won't line up text properly. In fact it'd look awful with any proportional font, and not much better with a fixed-width font (although you might get away with it if all your text strings were exactly the same length, or you went to the trouble of padding them out with spaces etc).

Malice - The best thing to do would be to pass all your texts to a function, thus:
ColumnText "Text 1", "Text 2", "Text 3"

Function ColumnText(A$,B$,C$)
  Text 0,0,A$
  Text 50,0,B$
  Text 100,0,C$
End Function



Perturbatio(Posted 2003) [#5]
Ooops! yes, of course. didn't consider that.

That function Gfk posted would work, but you might want to calculate the length of the longest piece of column data in each column so you know how wide they will be.


_PJ_(Posted 2003) [#6]
Yeah thanks - I know I could work around it, but I really thought there was a control code for it - I think there should be anyway!