Page 2 of 3
Re: Show indexing progress
Posted: Wed Sep 15, 2010 9:39 am
by cocoking
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.
Re: Show indexing progress
Posted: Wed Sep 15, 2010 10:35 am
by mrduck
cocoking wrote:TYVM, mrduck, for your suggestion.
Sorry, I do not understand what you mean by "DO EVENTS". Please elaborate.
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.
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....
Re: Show indexing progress
Posted: Wed Sep 15, 2010 11:55 am
by Roberto Lopez
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.
It process pending messages:
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);
}
Since if your app has some construct like:
Code: Select all
DO WHILE...
<Very long process>
ENDDO
System messages are not processed and your application enters in an 'not responding' state.
Re: Show indexing progress
Posted: Wed Sep 15, 2010 12:18 pm
by cocoking
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.
Re: Show indexing progress
Posted: Wed Sep 15, 2010 9:13 pm
by Roberto Lopez
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.
I'm not sure to had understood you, but I'll try to answer...
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.
Re: Show indexing progress
Posted: Thu Sep 16, 2010 8:13 am
by cocoking
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.
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.
Re: Show indexing progress
Posted: Thu Sep 16, 2010 12:22 pm
by Roberto Lopez
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.
Yes.
Please consider that @... style definitions can also be used. Check documentation.
Re: Show indexing progress
Posted: Fri Sep 17, 2010 2:43 am
by cocoking
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
Re: Show indexing progress
Posted: Fri Sep 17, 2010 12:47 pm
by Roberto Lopez
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
_HMG_SYSDATA is an internal data array, so, the user should not touch it at all.
Re: Show indexing progress
Posted: Fri Sep 17, 2010 5:05 pm
by cocoking
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.