FUNCTIONUnder review
IncProc
IncProc()Increments the progress bar created by Processa().
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.
Syntax
IncProc()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
ReturnExpected result
ProcRegua() defines the total and IncProc() advances the bar for each processed item.
- 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.
- 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.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.