Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP program seems to freeze but is running
Message
De
03/01/2014 17:45:49
 
 
À
03/01/2014 11:22:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01591290
Message ID:
01591320
Vues:
72
>I'm testing a long running vfp program and found these problems
>
>Wait window messages freeze (in different parts during different runs)
>Added debugout message, but it also freezes.
>I set escape on, but program doesn't respond to ESC
>Added saving message to disk which shows that program continues to run
>Finally process finishes correctly
>
>It's almost like it locks screen and keyboard out.
>
>I have windows 7 64 bit and VFP sp2. Any idea what may be the problem?

Naoto and Rick have pointed out the most likely thing, that you need to periodically issue DOEVENTS during your heavy processing.

I agree with Dragan's idea of using something other than WAIT as a progress display. For my long-running/unattended processes I do a lot of logging to text files, and I echo some of the log entries (including datetime) to the bottom of a scrolling editbox on a form.

WAIT is something of an odd duck, present in the product since the DOS days. I don't know how it's been implemented in Win32 but I suspect it's a kludge. I avoid it if at all possible; if I need to use it I make sure to issue WAIT CLEAR when I'm done with it (or before issuing another WAIT).

Long-running SQL queries block and can make the system unresponsive. Many years ago I was running large queries on slow hardware so I experimented with something like this:
SELECT ;
  ColumnsYouWant ;
  , MyUDF( DATETIME( ) ) AS JunkColumn ;
  FROM ...

FUNCTION MyUDF
LPARAMETERS ttDT

* Run every 5 seconds, (pseudocode only, below won't work as-is):
IF MOD( SEC( ttDT ), 5 ) = 0
  DOEVENTS

ENDIF

RETURN Something
Finally, there is the question of I/O to your disk/virtual memory subsystem. If your processing hammers the disk then your system as a whole (including UI) will be unresponsive, that's one of the weaknesses of current versions of Windows.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform