MC-Basic:STARTTASK$

From SoftMC-Wiki
Jump to: navigation, search
Language: English  • 中文(简体)‎

Starts task execution from the beginning of the task. Priority sets the priority level for task execution. The highest priority is 1, which causes the task to run after all realtime tasks have run. The lowest priority is 16. Tasks with the same priority level run via a round-robin procedure, which gives equal time to each task. A low priority task cannot interrupt a high priority task. If a task is killed, it can be restarted with this command. A task can be started and specified to run for a number of execution loops, then stop.

NOTE-Info.svgNOTE
The terminal operates at priority level 2. If a task is started at priority level 1, the command line is not operable until the task ends or until it releases the CPU.

Short form

STas$

Syntax

StartTask$ <task> {Priority=<level>} {NumberOfLoops=<number of loops>}

Availability

All versions

Type

<task>: String.
<priority level>: Long
<number of loops>: Long

Range

<priority level>: 1 to 16
<number of loops>: -1, 1 to MaxLong. The value -1 continuously runs the task.

Default

<priority level>: Priority set by the LOAD|LOAD$ commands.
<number of loops>: 1

Scope

Task or Terminal

Limitations

Is not executed if the <task> has started.

Examples

StartTask$ “Task1.Prg” Priority=8 NumberOfLoops=-1      'Runs Task1 forever

Or

Common Shared Str1 as string

Str1 = “Task1.Prg”

StartTask$ Str1

See Also