views:

16

answers:

1

I'm trying to figure out in all the Internets what's the special character for printing a simple tab in Pascal. I have to format a table in a CLI program and that would be handy.

+2  A: 

Single non printable characters can be constructed using their ascii code prefixed with #

Since the ascii value for tab is 9, a tab is then #9. Characters such constructed must be outside literals, but don't need + to concatenate:

E.g.

 const
     sometext  = 'firstfield'#9'secondfield'#13#10;

contains two fields separated by a tab, ended by a carriage return (#13) + a linefeed #10

The ' character can be made both via this route, or shorter by just ending the literal and reopening it:

 const 
    some2 = '''bla''';           // will contain 'bla' with the ticks.
    some3 = 'start''bla''end';   // will contain start'bla'end
Marco van de Voort