Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

SetDefault

SetDefault(aReturn,[cAlias],[uPar1],[uPar2],[cTamanho],[nFormato])

Applies legacy report options.

SetDefaultAdvPL
01 · OVERVIEW

Overview

In the manual, SetPrint populates aReturn and SetDefault prepares printing from that array. This is not a default-value function or generic setter. Leave reserved arguments reserved; historical cTamanho values are P/M/G and nFormato is 1 portrait or 2 landscape. The subset requires valid aReturn, confirmed SetPrint and report context; loading it opens no printer. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

SetDefault(aReturn,[cAlias],[uPar1],[uPar2],[cTamanho],[nFormato])

Parameters

aReturn
ArrayRequired

Confirmed SetPrint options.

cAlias
CharacterOptional

Printing alias.

uPar1 / uPar2
ReservedOptional

Do not assign a meaning.

cTamanho
CharacterOptional

P, M or G.

nFormato
NumericOptional

1 portrait, 2 landscape.

Return value

Nil in the historical reference.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed658()
    // Uninvoked block: requires already confirmed SetPrint options.
    Local bPrepare := {|aOptions,cAlias| SetDefault(aOptions,cAlias,,,"M",1)}
    ConOut(ValType(bPrepare))
Return Nil
Expected result

Creates block B without applying options or starting printing. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Check cancellation, report private state and output restoration. Do not copy dbCommitAll from old templates without a business requirement.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. AdvPL — O Manual. Referência histórica, p. 374–375. Contrato atual não homologado. 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