Page 1 of 1

"no respond" but App still working

Posted: Fri Aug 12, 2022 7:25 pm
by AUGE_OHR
hi,

i have a loop and 2 x "Say"

Code: Select all

STATIC PROCEDURE SayInfo( cInfo )
   DlRange.Label_INFO.Value := cInfo
RETURN

Code: Select all

STATIC PROCEDURE StartDownLoad( cRef, cCategory, nStart, nEnd )
   SayBarText( TIME() + " Start Import" )
   nTimeStart := SECONDS()
   FOR ii := nStart TO nEnd
      ...
      nAllItems := StripHTMLCode( cFile, cCategory, ii )  	// 2nd loop work
      ...
      nTimeCalc := ( SECONDS() - nTimeStart ) / nCount
      cText := "Time left : " + Sec2HMS( ( ( nEnd - nStart ) - nCount ) *  nTimeCalc )
      SayInfo( cText )  					// does not respond when "big" file
   NEXT
   SayBarText( TIME() + " End Import" )
   SayBarText( TIME() + " read " + LTRIM( STR( nEnd - nStart ) ) + " Topic : " + SEC2HMS( nTimeStop - nTimeStart ) )

Code: Select all

FUNCTION StripHTMLCode( cFile, cCategory, nThreadNo )
   DO WHILE nMemoPos < nMemoLen
         ...
         SayBarText( cAuthor + " " + cTopic )			// work
   ENDDO
it does work when have 100 Loop but not when have 7000 loop ...

"inner" loop with SayInfo() work but it say "no response"
"outer" loop with SayBarText() does NOT update ... and also "CLOCK" in Tasklist "stay" ... but App run

what do i miss :?:

Re: "no respond" but App still working

Posted: Sat Aug 13, 2022 7:11 am
by edk
You missed DO EVENTS in loops.

Re: "no respond" but App still working

Posted: Sat Aug 13, 2022 7:11 pm
by AUGE_OHR
hi,

Yes, you are right.

i have try to show it in a Loop but this was "too much"
i need more Time for System to "react" in a Loop so change and show it only every 10th Item

Code: Select all

   IF ( ( nCount ) % ( 10 ) ) == 0
      ...
      SayInfo( cText )

PROCEDURE SayInfo( cInfo )
   DlRange.Label_INFO.Value := cInfo
   DO EVENTS
thx for help