Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Space

Space(nCount) -> cSpaces

Creates a string of spaces.

SpaceAdvPL
01 · OVERVIEW

Overview

The argument specifies the number of spaces. Space(0) produces an empty string; a space-filled string is not Nil. Visible delimiters and Len make padding and length inspectable. Maximum limits in historical documents require build confirmation rather than universal assumptions. (Sources: refs. 1–2.)

02 · SYNTAX

Syntax

Space(nCount) -> cSpaces

Parameters

nCount
NumericRequired

Space count.

Return value

Character.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed671()
    Local cSpaces := Space(3)
    // Delimiters make padding visible.
    ConOut("["+cSpaces+"]")
    ConOut(Len(cSpaces))
Return Nil
Expected result

Displays [ ] and length 3. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Avoid excessive allocation; validate input limits before padding.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Space. Sintaxe e observações. TDN. Accessed on 2026-10-28.
  2. Atilio. dan-atilio/AdvPL. Maratona de Exemplos/Exemplo_452_Funcao_Space.prw. Arquivo completo consultado; adaptação editorial. Accessed on 2026-10-28.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha