| ProLinga-4GL Reference Manual |
|---|
THREAD — Start or stop 4GL logic in a thread.
THREAD START thread_name
THREAD STOP thread_name
The
At this stage threads can not be nested (yet).
. . . . . . COMMENT *** Start a thread from the main thread (foreground) THREAD START printOrders IF THREADSTATUS <> 0 ERROR "Order print batch could not be started." SEVERITY Error ENDIF . . . . . . THREAD STOP printOrders IF THREADSTATUS <> 0 ERROR "Order print batch could not be stopped or has already finished." SEVERITY Error ENDIF . . . . . .
Logic executed in a thread can check with the built-in function THREADEXIT() if a THREAD STOP command has been issued.
. . . . . . FOREVER IF THREADEXIT() = TRUE() THEN BREAK COMMENT *** Process logic in thread . . . . . . ENDFOR . . . . . .
| << TRANSACTION Command | XML Command >> |