Show indexing progress
Moderator: Rathinagiri
Re: Show indexing progress
TYVM, mrduck, for your suggestion.
Sorry, I do not understand what you mean by "DO EVENTS". Please elaborate.
Please bear with me, this is the first time I'm working with HMG.
Sorry, I do not understand what you mean by "DO EVENTS". Please elaborate.
Please bear with me, this is the first time I'm working with HMG.
Re: Show indexing progress
Win32 needs time to process the message queue (that contains orders to update the video) but if you are in a tight loop the queue handler never kicks in.cocoking wrote:TYVM, mrduck, for your suggestion.
Sorry, I do not understand what you mean by "DO EVENTS". Please elaborate.
So, during long processes, you must give win32 the opportunity to process the queue, and it is done (according to hmg manual) with the DO EVENTS command....
should be something like this:
object:Value = "index 1"
do events
index on......
object:Value = "index 2"
do events
index on....
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Show indexing progress
It process pending messages:cocoking wrote:TYVM, mrduck, for your suggestion.
Sorry, I do not understand what you mean by "DO EVENTS". Please elaborate.
Please bear with me, this is the first time I'm working with HMG.
Code: Select all
HB_FUNC( _PROCESSMESS )
{
MSG Msg;
if( PeekMessage((LPMSG) &Msg, 0, 0, 0, PM_REMOVE) )
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
hb_retl(1);
}
else
hb_retl(0);
}
Code: Select all
DO WHILE...
<Very long process>
ENDDO
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Show indexing progress
TYVM, mrduck. TYVM Roberto.
The DO EVENTS seemed to have done the trick. The display of files went step by step (fast but noticeable) unlike before when the display seemed like a one-time painting of the editbox).
When I tried a trace debug though, the editbox did not update until when control was returned to the ACTIVATE WINDOW (as before). When I step on the DO EVENTS commands, the editbox display was unchanged.
Could it be a behavior of Debug? Or could it be by design that windows are only updated at the end of the event loop?
Please correct me if my understanding is wrong.
Thanks a lot.
The DO EVENTS seemed to have done the trick. The display of files went step by step (fast but noticeable) unlike before when the display seemed like a one-time painting of the editbox).
When I tried a trace debug though, the editbox did not update until when control was returned to the ACTIVATE WINDOW (as before). When I step on the DO EVENTS commands, the editbox display was unchanged.
Could it be a behavior of Debug? Or could it be by design that windows are only updated at the end of the event loop?
Please correct me if my understanding is wrong.
Thanks a lot.
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Show indexing progress
I'm not sure to had understood you, but I'll try to answer...cocoking wrote:TYVM, mrduck. TYVM Roberto.
The DO EVENTS seemed to have done the trick. The display of files went step by step (fast but noticeable) unlike before when the display seemed like a one-time painting of the editbox).
When I tried a trace debug though, the editbox did not update until when control was returned to the ACTIVATE WINDOW (as before). When I step on the DO EVENTS commands, the editbox display was unchanged.
Could it be a behavior of Debug? Or could it be by design that windows are only updated at the end of the event loop?
Please correct me if my understanding is wrong.
Thanks a lot.
Activate Window is a wait state, similar to Clipper's READ.
So, your application will be 'stopped' there, until the window is closed.
Your code will be executed only on events (ie control's OnGotFocus/OnLostFocus). This is similar to functions associated to when and valid events in Clipper's @...GET.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Show indexing progress
So, the DEFINEs are equivalent to the @ SAY...GETs and ACTIVATE WINDOW is like READ.Activate Window is a wait state, similar to Clipper's READ.
So, your application will be 'stopped' there, until the window is closed.
Your code will be executed only on events (ie control's OnGotFocus/OnLostFocus). This is similar to functions associated to when and valid events in Clipper's @...GET.
It is during ACTIVATE WINDOW that the program finds time to (1) catch up on pending processes and (2) wait for the next user action, as requested/required by the control(s).
Then when main form is released, the program ends. That means all codes after the ACTIVATE WINDOW will not be executed.
I hope I got it right.
TYVM once again to Roberto, mrduck, esgici, and rathi.
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Show indexing progress
Yes.cocoking wrote: So, the DEFINEs are equivalent to the @ SAY...GETs and ACTIVATE WINDOW is like READ.
It is during ACTIVATE WINDOW that the program finds time to (1) catch up on pending processes and (2) wait for the next user action, as requested/required by the control(s).
Then when main form is released, the program ends. That means all codes after the ACTIVATE WINDOW will not be executed.
I hope I got it right.
TYVM once again to Roberto, mrduck, esgici, and rathi.
Please consider that @... style definitions can also be used. Check documentation.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Show indexing progress
Thank you, Roberto.
Speaking of documentation, has there been a documentation about the usage of the _HMG_SYSDATA array? Would you recommend using it for debugging?
Thanks,
cocoking
Speaking of documentation, has there been a documentation about the usage of the _HMG_SYSDATA array? Would you recommend using it for debugging?
Thanks,
cocoking
- Roberto Lopez
- HMG Founder
- Posts: 4023
- Joined: Wed Jul 30, 2008 6:43 pm
Re: Show indexing progress
_HMG_SYSDATA is an internal data array, so, the user should not touch it at all.cocoking wrote:Thank you, Roberto.
Speaking of documentation, has there been a documentation about the usage of the _HMG_SYSDATA array? Would you recommend using it for debugging?
Thanks,
cocoking
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: Show indexing progress
I definitely have no intention to touch or modify its contents. I was just hoping I could get additional info for debugging my programs or see if it could help me understand how HMG works.
Anyway, I take it as being undocumented at this time.
TYVM, Roberto, for taking time to help. I really appreciate it.
Anyway, I take it as being undocumented at this time.
TYVM, Roberto, for taking time to help. I really appreciate it.