Siebel VB Language Reference > Siebel VB Language Reference >

Spc Function


This standard VB function prints a specified number of spaces.

Syntax

Spc(number)

Argument
Description
number
An integer or integer expression indicating the number of spaces to print

Returns

A string of spaces in the target of a Print statement.

Usage

The Spc function can be used only inside a Print statement.

When the Print statement is used, the Spc function uses the following rules for determining the number of spaces to output:

Example

This example outputs five spaces and the string ABCD to a file. The five spaces are derived by taking 15 Mod 10, or the remainder of dividing 15 by 10.

Sub Button_Click
   Dim str1 as String
   Dim x as String * 10
   str1 = "ABCD"
   Open "C:\temp001" For Output As #1
   Width #1, 10
   Print #1, Spc(15); str1
   Close #1
   Open "C:\TEMP001" as #1 Len = 12
   Get #1, 1,x
   Close #1
   Kill "C:\temp001"
End Sub

See Also

Print Statement
Space Function
Tab Function
Width Statement


 Siebel VB Language Reference
 Published: 18 June 2003