This example illustrates how to get the PID of FLY!, wait for a few seconds and then terminate the process.
The GetPID() intrinsic returns -1 if it fails, the process id otherwise.
local int PID, int PID2, int Success
PID = RunTask("fly", "", "", Null)
call Sleep(3)
PID2 = GetPIDByName( "fly" )
Print "PID = ", PID
Print "PID2 = ", PID2
Success = KillTask( PID )
Print "Task killed? ", Success
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.