Harbour Reference Guide

 

SPACE()

Returns a string of blank spaces

Syntax

SPACE( <nSize> ) --> cString

Arguments

<nSize> The lenght of the string

Returns

<cString> An string containing blank spaces

Description

This function returns a string consisting of <nSize> blank spaces. If the value of <nSize> is 0,a NULL string will be returned.

This function is useful to declare the lenght of a character memory variable.
Examples
      FUNC MAIN
      LOCAL cBigString
      LOCAL cFirst
      LOCAL cString := Space(20)   //Create an characte memory variable
                                   // with lenght 20
      ? len(cString)      // 20
      cBigString:=space(100000)    // create a memory variable with 100000
                                   // blank spaces
      ?  len(cBigString)
      Use Tests New
      cFirst:= makeempty(1)
      ? len(cFirst)
      Return Nil

      Function MakeEmpty(xField)
      LOCAL nRecord
      LOCAL xRetValue

      If !empty(alias())
          nRecord:=recno()
          dbgoto(0)
          if valtype(xField)=="C"
              xField:= ascan(dbstruct(),{|aFields| aFields[1]==upper(xfield)})
          else
              default xField to 0
              if xField < 1 .or. xField>fcount()
                  xfield:=0
              endif
          endif
          if !(xfield ==0)
              xRetvalue:=fieldget(xfield)
          endif
          dbgoto(nrecord)
      endif
      return( xRetvalue)
Tests
      See examples
Status

Ready

Compliance

This function is Ca-Clipper compliant in all aspects, with the exception don't have the Clipper 64Kb string length.

Platforms

All

Files

Library is Rtl

See Also

 




[Source Forge]

Other Docs Categories

Advantage Database RDD
Array
Binary conversion
Classes
Code Block
Console input
Conversion
Conversion Tools
DOS
Data input and output
Database
Database Tools
Date
Dos Tools
Environment
Error recovery
Events
File management
GT
Harbour Tools
Internal
Low Level
Math
Misc
Miscellaneous
Nation
Object manipulation
Operating System Specific
Parameter Checks
String Tools
Strings
TBrowse Method
TBrowse class
Terminal
Time
Utility
Variable Management

 

Last updated on 2001/07/30