DC_GetProgress with unknown upper bound
Posted: Tue Aug 21, 2018 11:05 am
Hey, Roger!
I commonly use function DC_GetProgress(). I'm doing this is standard and quite successfully. But recently I wanted to display the stage of the execution process not by the number of operations, but by the time of execution. I measured the time elapsed since the beginning of the process and calculated the forecast for the end. After that I want to display, and the forecast of the end changes all the time. And not always in a big way, and sometimes less. But the upper limit of the range must be set before running the DC_GetProgress () function. Is it possible somehow not to ask from outside? Or maybe change it inside the loop execution, as if DCPROGRESS also is inside it? As a result, now sometimes the progress bar is displayed, and sometimes not as lucky.
[/size]
I commonly use function DC_GetProgress(). I'm doing this is standard and quite successfully. But recently I wanted to display the stage of the execution process not by the number of operations, but by the time of execution. I measured the time elapsed since the beginning of the process and calculated the forecast for the end. After that I want to display, and the forecast of the end changes all the time. And not always in a big way, and sometimes less. But the upper limit of the range must be set before running the DC_GetProgress () function. Is it possible somehow not to ask from outside? Or maybe change it inside the loop execution, as if DCPROGRESS also is inside it? As a result, now sometimes the progress bar is displayed, and sometimes not as lucky.
Code: Select all
nMax = N_InpFiles
Mess = L('2.3.2.6. Объединение нескольких файлов исходных данных в один'
@ 4,5 DCPROGRESS oProgress SIZE 70,1.1 MAXCOUNT nMax COLOR GRA_CLR_CYAN PERCENT EVERY 100
DCREAD GUI TITLE Mess PARENT @oDialog FIT EXIT
oDialog:show()
nTime = 0
DC_GetProgress(oProgress,0,nMax)
FOR ff=1 TO N_InpFiles
DC_GetProgress(oProgress, ++nTime, nMax)
NEXT
*MsgBox('STOP')
DC_GetProgress(oProgress,nMax,nMax)
oDialog:Destroy()