Spc (function)

Syntax

Spc(numspaces)

Description

Prints out the specified number of spaces. This function can only be used with the Print and Print# statements.

Comments

The numspaces parameter is an Integer specifying the number of spaces to be printed. It can be any value between 0 and 32767.

If a line width has been specified (using the Width statement), then the number of spaces is adjusted as follows:

  numspaces = numspaces Mod width

 

If the resultant number of spaces is greater than width - print_position, then the number of spaces is recalculated as follows:

  numspaces = numspaces – (width – print_position)

These calculations have the effect of never allowing the spaces to overflow the line length. Furthermore, with a large value for column and a small line width, the file pointer will never advance more than one line.

Example

This example displays 20 spaces between the arrows.

Sub Main()
  Print "I am"; Spc(20); "20 spaces apart!"
  Sleep (10000) 'Wait 10 seconds.
End Sub

See Also

Tab (function); Print (statement); Print# (statement).

More information

S