bAcaoCode block executed inside the processing window.
AdvPL GuideProcessa( <bAcao>, [<cTitulo>], [<cMsg>], [<lAborta>] )Creates a processing window with a progress meter to track action execution.
Processa creates a dialog with a progress meter and runs an action provided as a code block. The called routine may receive a logical variable by reference to identify cancellation requests. Together with ProcRegua and IncProc, it defines the total number of steps and visually updates progress.
Processa( <bAcao>, [<cTitulo>], [<cMsg>], [<lAborta>] )bAcaoCode block executed inside the processing window.
cTituloWindow title.
cMsgMessage displayed below the progress meter.
lAbortaWhen true, enables the cancel button.
Nil, according to the TOTVS Support Center reference.
#Include "TOTVS.ch"
User Function RunProcess()
Local bAction := {|lEnd| U_ProcessItems(@lEnd)}
Local cTitle := "Processing"
Local cMsg := "Processing items..."
Local lAbort := .T.
Processa(bAction, cTitle, cMsg, lAbort)
Return
User Function ProcessItems(lEnd)
Local nItem
Local nTotal := 100
ProcRegua(nTotal)
For nItem := 1 To nTotal
If lEnd
Exit
EndIf
// Process the item here.
IncProc()
Next nItem
ReturnProcessa opens the window; ProcRegua defines 100 steps and IncProc advances the meter during the For...Next loop.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.