Running Programs Lock Up

jamesmc

Member
Hello Folks,

I am having a little bit of difficulty when running GUI programs. The program is a little report criteria screen that accepts two values, then goes away and pulls information from a database.

The report is sent only to a text file but while the program is querying the database my entire session will lock up and not come back until the program has finished.

Is there anything I can do to stop this from happening? Maybe splitting the code in two (criteria is one program, processing in another?). I just need a solution that will allow me to still control the GUI session (I can't even move the program window while it is running!).

Progress 8.3b
Win 95 OSR 2
Database on RS6000
Code running via a GUI menu system not UIB.

Thanks,

James.
 

MurrayH

Member
Progress on Windows

Yes .. that sounds like Progress on windows. That happens on NT was well :(

Your best bet is to split it into two or more programs. The first generates the parameters of the report and the second reads the parameters from somewhere. If you simply have the first call the second directly it will still lock up (sigh). Maybe you could use an Async. AppServer but then you still need to keep the first program alive.

Murray
 

mra

Junior???? Member
The problem is, that while running in a loop, Progress can not process GUI events which will make your app. "lock-up".

If you insert "process events" statements at strategic places in your loop, you allow Progress to do repaint etc.
NOTE however that this also allows the user to close the screen or something similar, like pressing a "GO" button again.

Another solution would be to use asynchronous appservers as suggested.

Regards
Mike
 

NickA

Member
A bit of sample code...

-----

DEFINE BUTTON btnCancel LABEL "Cancel".

FORM
"Please wait ... "
btnCancel
WITH 1 COLUMN FRAME fraProcess THREE-D NO-LABELS VIEW-AS DIALOG-BOX TITLE "Transaction in progress".

ON CHOOSE OF btnCancel
ASSIGN gAbort = TRUE.

ENABLE btnCancel WITH FRAME fraProcess.
VIEW FRAME fraProcess.

_TRANSACTION:
DO TRANSACTION ON ERROR UNDO _TRANSACTION, LEAVE _TRANSACTION:

FOR EACH Customer:
PROCESS EVENTS.
IF gAbort THEN
UNDO _TRANSACTION, LEAVE _TRANSACTION.

/* Update customer record */

END.

END.

-----

Whilst the transaction is running, a dialog box (fraProcess) is popped up that allows the user to click 'Cancel' (btnCancel) to abort the transaction.

As 'fraProcess' is a dialog, the window underneath can't be accessed.

As 'PROCESS EVENTS' is called, everything gets nicely refreshed on each pass.
 

Fritz Bruder

New Member
Hi James

Put the statement PROCESS EVENTS inside the loop!

This also enables you to check a cancel-button if cancelling is desired. But slows down the performance a bit.

Fritz Bruder
 
Top