Skip to content

Commit 9826745

Browse files
committed
update README
1 parent bfac223 commit 9826745

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

README.md

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
# task_status
2-
KAREL utility to check the status of a task from TPE
1+
# TASK_STATUS
2+
3+
KAREL utility to check the status of a task from TPE.
4+
5+
Because there's no other way to check if a task is running
6+
from TPE. This can be a problem if you're counting on a
7+
background task to be running or an asynchronous task to
8+
be not running before firing it off again.
9+
10+
## Usage
11+
12+
CALL TASK_STATUS('PROGRAM_NAME', outputRegId) ;
13+
14+
| Return Value | Meaning |
15+
| ------------ | ------- |
16+
| -2 | Run request has been accepted |
17+
| -1 | Abort request has been accepted |
18+
| 0 | Task is running |
19+
| 1 | Task is paused |
20+
| 2 | Task is aborted |
21+
| Other | Refer to Error Code manual |
22+
23+
24+
## Example
25+
26+
LBL[1] ;
27+
CALL TASK_STATUS(‘ASYNC_TASK’,1) ;
28+
IF R[1:TASK STATUS]<>2,JMP LBL[501] ;
29+
! task is aborted ;
30+
RUN ASYNC_TASK ;
31+
END ;
32+
;
33+
LBL[501] ;
34+
! task is still doing something or hung up ;
35+
JMP LBL[1] ;

0 commit comments

Comments
 (0)