Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 809 Bytes

File metadata and controls

22 lines (14 loc) · 809 Bytes

SPACE()

This is a function that has pretty much outlived its usefulness. It returns a string composed of a specified number of blanks (CHR(32)).

Usage

cMyString = SPACE( nLength )

Before EMPTY() was added to FoxPro, to determine if a character field had any data in it, you'd compare it to SPACE(LEN(fieldname)). This was considered a forward-thinking solution since it would continue to work even if the field's size was increased. But EMPTY() performs the same test more quickly and is more readable.

The only use left for SPACE() is for initializing variables to a certain size.

Example

cLastName = SPACE(30)  && sets variable cLastName to 30 spaces

See Also

Empty(), Len(), Replicate()