Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Has THREADING got something to do with this?
Message
From
24/05/2002 22:19:32
 
 
To
24/05/2002 21:06:56
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00661309
Message ID:
00661313
Views:
21
Everybody,

THIS ONE REPLACES THE FIRST MESSAGE... all mixed up... must the beer... :-)

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
if eof()
this.enabled = .f.
? 'timer disabled... last record reached'
return
endif
skip
endif

? 'processing...'
thisform.execute( commands.task )

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

The thisform.execute method goes something like this:

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

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

MY QUESTION:

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?

Thank you very much for any help.

Dennis
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform