Space$() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns a string consisting only of spaces. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

Space$( num_expr ) 

num_expr is a SmallInt numeric expression.

Return Value

String

Description

The Space$() function returns a string num_expr characters long, consisting entirely of space characters. If the num_expr value is less than or equal to zero, the Space$() function returns a null string.

Example

Dim filler As String 
filler = Space$(7)
' filler is now equal to the string "       " 
' (7 spaces)
Note "Hello" + filler + "world!" 
'this displays the message "Hello       world!"

See Also:

String$() function