Space, Space$ Functions

Named Arguments

No

Syntax

Space(number)


number

Use: Required

Data Type: Integer

An expression evaluating to the number of spaces required.

Return Value

A Variant of subtype String containing number spaces (in the case of Space) or a String containing number spaces (in the case of Space$).

Description

Creates a string containing number spaces.

Rules at a Glance

While number can be zero (in which case the function returns a null string), runtime error 5, "Invalid procedure call or argument," is generated if number is negative.

Programming Tips and Gotchas

You can use the Space function to both pad and clear data stored in fixed-length strings. For example, the following code fragment fills a fixed-length string with spaces:

Dim strFixed As String * 32
...
strFixed = Space(Len(strFixed))

See Also

String Function
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.54.242