Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

ProcRegua

ProcRegua( <nTotal> )

Defines the total value of the progress bar used by Processa().

FrameworkProcessingProgress bar
01 · OVERVIEW

Overview

ProcRegua() tells the Processa() progress bar how many steps will be executed. After that, each IncProc() call advances the bar until the defined total is completed.

02 · SYNTAX

Syntax

ProcRegua( <nTotal> )

Parameters

nTotal
NumericRequired

Total number of steps the routine intends to execute.

03 · PRACTICAL EXAMPLE

Defining the total number of items

#Include "TOTVS.ch"

Static Function ProcessaItens(aItens, lFim)
    Local nItem

    ProcRegua(Len(aItens))
    For nItem := 1 To Len(aItens)
        If lFim
            Exit
        EndIf

        // Processamento do item
        IncProc()
    Next
Return
Expected result

The progress bar starts representing the number of items in the array.

BEST PRACTICES
  • Defina o total antes de iniciar o laço principal.
  • Se o total for calculado por consulta ou array, use a quantidade real de registros.
  • Combine com IncProc() para atualizar a régua durante o processamento.

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