Examples: Spc function

'The Print # statement prints numbers with a leading space (omitted if the number is negative) and a trailing space.

In this example, Spc(1) inserts another space following each number and its trailing space. The second and fourth lines each begin with two spaces; the first space on the line is generated by Spc(1), and the second space on the line is the leading space before the number first printed on the line (3 or 8).

In the second line, the number 4 is followed by three spaces. These last four characters can be read as "4, trailing space, Spc(1), leading space".

Open "spc.tst" For Output As #1
' Define line width in SPC.TST as 10 characters.
Width #1, 10
For i = 0 To 9
   Print #1, i; Spc(1);
Next i
Close #1
' Output to the file (the display of each line here includes
' a leading quote character (') and a leading space):
'  0   1   2 
'   3   4   
' 5   6   7 
'   8   9