Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

SetRegua

SetRegua( <nTotal> )

Defines the total of the progress bar used by RptStatus().

ReportsProcessingProgress bar
01 · OVERVIEW

Overview

SetRegua() prepares the progress bar displayed by RptStatus(), informing the total number of steps for a report or processing routine with visual tracking.

02 · SYNTAX

Syntax

SetRegua( <nTotal> )

Parameters

nTotal
NumericRequired

Total value of the progress bar.

03 · PRACTICAL EXAMPLE

Progress bar in a report

#Include "TOTVS.ch"

User Function ExSetRegua()
    Local bAcao := {|lFim| U_GeraRel(@lFim) }

    RptStatus(bAcao, "Relatório", "Gerando informações...")
Return

User Function GeraRel(lFim)
    Local nLinha

    SetRegua(50)
    For nLinha := 1 To 50
        If lFim
            Exit
        EndIf

        IncRegua()
    Next
Return
Expected result

SetRegua() defines the total and IncRegua() updates progress inside RptStatus().

BEST PRACTICES
  • Use SetRegua() em conjunto com RptStatus() e IncRegua().
  • A diferença principal em relação a ProcRegua() é o contexto: SetRegua() aparece associado ao fluxo de RptStatus().
  • Mantenha a contagem alinhada ao número real de incrementos.

Related content

REFERENCES
  1. Help ADVPL.chm. Help AdvPL/APMSLib, documentação oficial histórica, 15 mar. 2004. Conteúdo resumido, reorganizado e marcado para revisão contra documentação atual da TOTVS quando disponível.
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