KillTask

Demonstrates how to terminate a task by a process id.

Remarks

This example illustrates how to terminate FLY! using the PID of the process.

KillTask() returns -1 if the kill failed, 0 if it may have been killed, and 1 if it was killed for sure.

Code

 local int PID, int Success

 PID = RunTask("fly", "", "", Null)

 Print "PID = ", PID

 call Sleep(3)

 Success = KillTask( PID )

 Print "Task killed? ", Success

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.