"no respond" but App still working

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

"no respond" but App still working

Post 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 :?:
have fun
Jimmy
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: "no respond" but App still working

Post by edk »

You missed DO EVENTS in loops.
User avatar
AUGE_OHR
Posts: 2117
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: "no respond" but App still working

Post 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
have fun
Jimmy
Post Reply