OLELCID

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()


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net