| START() | Start task. |
| TASKGETMSG() | Get message. |
| TASKID() | Return task identifier. |
| TASKPEEKMSG() | Get message. |
| TASKSENDMSG() | Send message to task. |
| TASKSTART() | Resume all tasks what was stopped. |
| TASKSTOP() | Stop all tasks with the exclusion current task. |
START(<vTask>, [<vPar1>,,, <vParN>]) --> <nTaskID>
Returns numeric value - is the task identifier.
START() starts task in parallel mode and passes it some parameters <vPar1>,,, <vParN>.
ts := @task2()
...
? START("task1", "Ann", "Jhon", "Mary")
...
? START(ts, 200, 100)
...
? START({|p1, p2| qout("Start code block"), ..., qout("Code block finished")})
...
function task1(a, b, c)
qout('Start task1')
...
qout('task1 finished')
return .T.
static function task2(x, y)
qout('Start task2')
...
qout('task2 finished')
return
No dependies of platform.
TASKGETMSG() --> <vMsg>
No arguments
Returns var <vMsg>, what was sended from a TASKSENDMSG().
TASKGETMSG() gets message from task input queue and returns it. If no message available, waits forever.
static id
id := START("func1")
for i:=1 to 10
TASKSENDMSG(id, time())
sleep(i)
next
....
function func1()
do while .T.
? "task got: ", TASKGETMSG()
enddo
return
No dependies of platform.
TASKID() --> <nTaskID>
No arguments
Returns task identifier as numeric value.
TASKID() returns current task identifier <nTaskID> as numeric value.
TASKSTOP() ? TASKID() TASKSTART()
No dependies of platform.
TASKPEEKMSG() --> <vMsg>
No arguments
Returns var <vMsg>, what was sended from a TASKSENDMSG().
TASKPEEKMSG() gets message from task input queue and returns it. If no message available, immediatly returns NIL.
static id
id := START("func1")
for i:=1 to 10
TASKSENDMSG(id, time())
sleep(i)
next
....
function func1()
do while .T.
? "task got: ", TASKPEEKMSG()
enddo
return
No dependies of platform.
TASKSENDMSG(<nReceiverID>, <vMsg>[, <lWait>]) --> <lResult>
Returns logical value <lResult>, TRUE if message was delivered.
TASKSENDMSG() sends var <vMsg> to task with identifier <nReceiverID> and returns returns TRUE if operation successfully.
static id
id := START("func1")
for i:=1 to 10
TASKSENDMSG(id, time())
sleep(i)
next
....
function func1()
do while .T.
? "task got: ", TASKGETMSG()
enddo
return
No dependies of platform.
TASKSTART() --> NIL
No arguments
Returns NIL.
TASKSTART() resumes all tasks what was stopped of function TASKSTOP().
function Task_stop() TASKSTOP() .... return .... Task_stop() TASKSTART()
No dependies of platform.
TASKSTOP() --> NIL
No arguments
Returns NIL.
TASKSTOP() stopeds all tasks with the exclusion current task.
function Task_stop() TASKSTOP() .... return
No dependies of platform.