Function Space() Foundation

Creates a character string consisting only of blank spaces.

Syntax
Space( <nCount> ) --> cSpaces
Parameters
<nCount>
<nCount> is the number of blank spaces included in the character string returned.
Return

Space() returns a character string which consists only of blank spaces (Chr(32)). The maximum length of the character string is not limited in Xbase++. When the value zero is passed, a null string ("") is returned.

Description

The character function Space() creates a character string consisting of <nCount> blank spaces. The same thing can be accomplished by the call Replicate( Chr(32), <nCount>). Space() is frequently used to initialize a variable with a blank character string prior to editing in a GET field.

Examples
Initialization of a character variable with Space()

// In the example a LOCAL variable is initialized with Space() 
// and then edited with a GET. 

PROCEDURE Main 
   LOCAL cString := Space(30) 

   CLS 
   @ 0,0 SAY "Input:" GET cString 
   READ 

RETURN 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.