ID : 5282
KillByName
Function
Forcibly kill a designated task. Unlike Kill command, you can use a formula for task name.
Syntax
KillByName task name[, Synchronizing flag]
Guaranteed Entry
- Task name
- Specify a task name by String Type data. Refer to "How to Designate a Task Name."
- Synchronizing flag
- Specify whether the processing is executed synchronously by integer type data. Specify 0, 1, -1 as shown table below. This is omittable. This should be "0" if it is omitted.
flag Description 0, OFF, or False Asynchronous processing (Execute next process without waiting the end of the specified task.) 1 (or ON), -1 (or True) Synchronous processing (Execute next processing after the specified task ends)
Description
At the time of program execution, evaluate a formula designated as a task name and create the task name dynamically to Kill. This is useful to Kill sequential named tasks at a time.
Except format, other behaviors are the same as Kill.
Related Terms
Kill, others are the same as Kill.
Attention
- Refer to Kill.
- If a specified task is not found, "81500029: Failed to find a file." is displayed.
Example
In the following example, Kill the 9 (Pro2 to Pro10) tasks.
'!TITLE "Force-quit a Task Using a Formula"
'Pro1.pcs
Sub Main
TakeArm Keep = 0
Dim n As Integer
'Create task name Pro2 to Pro10 using a formula and force-quit them
For n = 2 To 10
KillByName "Pro" & n
Next
End Sub
ID : 5282