Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What do you mean 'not responding'? Busy!
Message
De
26/01/2015 02:55:46
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
25/01/2015 11:05:13
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01614202
Message ID:
01614309
Vues:
56
>>>>>It's a conversion, which means many insert or update statements executed one at a time, and code to create those records from cursors previously pulled. The initial big SQL to get those cursors usually finishes in a few seconds, dozen at worst. It's the time it takes to write 20000 or 300000 records across the wire... and when the time to give a progress indicator, every 100 records, is sometimes longer than the polling interval, so doevents (I didn't put Force there, but may try) doesn't do much except occasionally repaint the _screen and command window - and even that works for a while and then stops.
>>>>>
>>>>>The code does go to the end, though.
>>>>
>>>>20 - 300K recs across the wire in 1 statement ? If so, Talk, Odometer and similar settings are ???
>>>
>>>No, no, one record at a time, being pushed from a cursor (which may have come from dbfs, csv, xls, sql, access...) to SQL. And it's not too much about speed either, it's about me being blinded while it runs.
>>
>>Ok, then you are in a vfp loop and the main problem of a sprinkled in doevents, doevents force, wait window or similar is the performance hit it can trigger if asked to run on every record. so tailor your function not to tally to any fixed No. of recs which might take different time lengths, but to fire the wanted effect at first occurrance after [3..12] secs since the last time the payload ran, similar to structuring the frequency of progress bar updates to the duration of tie spent and attention span of onlooker.

OK, here's the code:
Procedure TapDance()
*[2015/01/26 02:33:38] trying to avoid Windows blanking me screen

			If Recno() % 10 = 0 and seconds()> this.lastTap
				DOEVENTS force
				Wait Window This.Tablename+Textmerge(" <<RECNO()>>/<<RECCOUNT()>>") Nowait
					this.olog.log(textmerge([<<recno()>> records done]))
				this.lastTap=seconds()+hWindowsTapInterval
			Endif
EndProc
It does dance :). In the current conversion, the interval of 5 seconds (as I have #defined hWindowsTapInterval on first try) is mostly sufficient to cover 20, sometimes 30 records - mostly depending on how much is there to update (presently nothing actually, as I'm rerunning it on the same data as on friday). The icon on the taskbar gets briefly wider, for the part of the second when it is "myapp (not responding)" and all the icons shuffle to the left for the duration of less than a second, then reshuffle back. The name of the method is, therefore, 100% appropriate, thanks!

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform