Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Has THREADING got something to do with this?
Message
De
24/05/2002 21:06:56
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Has THREADING got something to do with this?
Divers
Thread ID:
00661309
Message ID:
00661309
Vues:
54
Dear All,

This is what I have done:

I created a table named COMMANDS with only one field named TASK. In it, I put some records with 'commands' such as:

1. SELECT TOP 1 FROM Testdata ORDER BY AMOUNT
2. WAIT WINDOW NOWAIT 'hi'
3. SELECT * FROM TestData WHERE ZIP='142343'
4. DO LOOPER (JUST LOOPS THRU A 100,000 RECORD TABLE)
5. WAIT WINDOW NOWAIT 'GOODBYE'

I purposedly alternated the records with commands that will take a while to finish and some which will finish faster.

I then created a form, put a timer control with interval of 1000. The timer event goes something like this:

************

SELECT Commands
if thisform.first && set to .T. initially
go top
thisform.first = .f.
else
? 'eof occurred at a bad place'
skip
endif

if eof()
this.enabled = .f. && disable this timer
? ' timer disabled '
else
? 'processing...'
thisform.execute( commands.task )
endif

*********************

The thisform.execute method goes something like this:

LPARAMETER lccommandtodo
&lccommandtodo
? lccommandtodo + ' finished...'

**********************

Upon running the form, the 'eof occurred at a bad place' message comes up after every task is executed.

These are my questions:

1. I was hoping that the 'faster' task could be finished first even if the earlier task is still being done. Is this what 'threading' is all about?

2. Why does the 'eof occurred at a bad place' occur? Is it because of the timer interval (too short)?

Thank you very much for any help.

Dennis
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform