
Chapter 14 Multitasking Control Statements
14-1
14.1 Task Control
RUN (Statement)
Function
Concurrently runs another program.
Format
RUN <Program name> [(<Argument>[,<Argument>…])][,<RUN option>]
Explanation
This statement allows the currently executed program to run a program
designated in <Program name>. However, the current program cannot run the
program itself.
Only values are usable for <Argument>. Even if you specify reference pass, the
reference data will automatically be changed to values. But you cannot use local
array.
For <RUN option>, there are PRIORITY (or P) and CYCLE (or C).
PRIORITY (or P)
Designates the priority of a program. If ignored, the default value of 128 is set.
The smaller the value, the higher the level of priority. The setting range is from
102 to 255.
Note: The priority over of the supervisory task cannot be changed.
CYCLE (or C)
Designates an alternate cycle (time of each cycle when a program is run
repeatedly). This option is expressed in msec. The setting range is from 1 to
2,147,483,647.
You cannot start any program that includes arguments when using the cycle
option.
Related Terms
CALL, GOSUB
Example
DEFINT Li1 = 1, Li2 =2, Li3 = 3
RUN samp1 C=1000 'Runs samp1 in parallel n (C=1000).
RUN samp2(Li1) 'Runs samp2 using the Li1 argument in parallel.
RUN samp3(Li1,Li2),PRIORITY = 129
'Runs samp3 using the Li1 and Li2 arguments in parallel
'(P = 129).
RUN samp4(Li1,Li2),PRIORITY = 150
'Runs samp4 using the Li1 and Li2 arguments in parallel
'(P = 150).
RUN samp5(Li1,Li2,Li3),P = 120
'Runs samp5 using the Li1, Li2, and Li3 arguments in parallel
'(P = 120)
Comentários a estes Manuais