Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Cabec

Cabec( <cTitulo>, <cCabec1>, <cCabec2>, <cPrograma>, <cTamanho>, [nFormato], [uPar7], [lPerg], [cLogo] ) --> nLin

Emits a header within a prepared legacy-report workflow.

CabecAdvPL
01 · OVERVIEW

Overview

Cabec belongs to legacy printing and returns a line number. The historical page requires a title, two heading lines, program and P/M/G size; optional positions cover format, a reserved slot, questions and a BMP logo. The example is a fragment for an already configured test output: it does not prepare printer, spool, pagination or report closure. Nil preserves the reserved seventh slot; .F. explicitly disables printing questions rather than relying on MV_IMPSX1. The returned line is not a printed-record count. (TOTVS, n.d., ref. 1)

02 · SYNTAX

Syntax

Cabec( <cTitulo>, <cCabec1>, <cCabec2>, <cPrograma>, <cTamanho>, [nFormato], [uPar7], [lPerg], [cLogo] ) --> nLin

Parameters

cTitulo
CharacterRequired

Report title.

cCabec1
CharacterRequired

First heading line.

cCabec2
CharacterRequired

Second heading line.

cPrograma
CharacterRequired

Program identifier.

cTamanho
CharacterRequired

P, M or G according to format.

nFormato
NumericOptional

Print format; 15 in the example.

uPar7
AnyOptional

Reserved; keep Nil.

lPerg
LogicalOptional

Print questions; if omitted checks MV_IMPSX1.

cLogo
CharacterOptional

BMP logo name in the supported workflow.

Return value

Line number returned by the printing workflow.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function EdCabec()
    Local nLine
    // Only within a legacy workflow with test output prepared.
    nLine := Cabec("Editorial summary", "Code  Description", "", "EDCAB", "M", 15, Nil, .F.)
    ConOut(cValToChar(nLine))
Return Nil
Expected result

Proposes emitting the header and recording the line; without a prepared printing workflow the example is not self-contained. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Test with a test output, fictional data and no automatic printer delivery. Handle pagination and closure in the report program.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Cabec. TDN. Accessed on 2026-10-26.
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