Skip to Content
0
Former Member
Jul 27, 2016 at 07:12 AM

Apparent freezing of an application during an involved large loop

212 Views

I have an issue with a progress bar and progress microhelp 'freezing' mid-processing during a loop that could vary up to 70,000 rows.

The loop in some instances could take up to 5 minutes to process and, if the progress bar and microhelp 'freeze', it gives the User the impression the application has crashed. Yet the application is still peddling away 'behind' the Window and will process if given time, although 5min before a computer screen is a long time.

I am using PB 12.5 classic on Windows 8 - the problem occurs both in the development and executional mode

I have used a Yield() statement. This is the loop code, excluding the primary processing code - the primary code is essentially creating entity relationship links and loading them into a temporary table.

FOR ll_count = 1 TO ll_rows

Yield()

If MOD(ll_count,20) = 0 Then

If IsValid(ahpb_progress) then

li_percentage = INT((ll_count / ll_rows) * 100 )

ahpb_progress.position = li_percentage

gnv_app.of_GetFrame ().SetMicrohelp ( "Processing row " + String ( ll_Count ) + ", please wait..." )

End if

End If

....

....

....

NEXT

Any advice on how to stop the apparent 'freezing' would be appreciated.