Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

IncProc

IncProc()

Increments the progress bar created by Processa().

FrameworkProcessingProgress barInterface
01 · OVERVIEW

Overview

IncProc() advances by one unit the progress bar prepared inside a routine executed by Processa(). It is usually used in processing loops to visually indicate that the routine is still running.

02 · SYNTAX

Syntax

IncProc()
03 · PRACTICAL EXAMPLE

Incrementing the Processa progress bar

#Include "TOTVS.ch"

User Function ExIncProc()
    Local bAcao := {|lFim| U_Executa(@lFim) }

    Processa(bAcao, "Processamento", "Processando registros...", .T.)
Return

User Function Executa(lFim)
    Local nItem

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

        // Processa o item atual
        IncProc()
    Next
Return
Expected result

ProcRegua() defines the total and IncProc() advances the bar for each processed item.

BEST PRACTICES
  • Use ProcRegua() antes do laço para informar o total esperado de passos.
  • Chame IncProc() a cada item efetivamente processado.
  • Quando Processa() permitir cancelamento, respeite o parâmetro lógico recebido pelo bloco de ação.
COMMON PITFALLS
  • Without ProcRegua(), the progress bar may not correctly reflect execution percentage.
  • Incrementing the bar outside the same routine controlled by Processa() makes the flow harder to understand.
  • Because the source is historical, validate behavior in current Protheus releases.

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