>Hi Ed:
>
>>>
SET CLASSLIB TO PROCESS ADDITIVE
>>>oRun=CREATEOBJ('API_APPRUN','C:\AW\AWREMOTE.EXE -M=D -N="MCIB"','C:\AW','NOR')
>>>
>>>oRun.LaunchApp()
>>>LOCAL mCount
>>>mCount = 0
>>>DO WHILE oRun.CheckProcessExitCode() = 259
>>> mCount = mcount + 1
>>> IF mCount < 3
>>> WAIT TIMEOUT 5
>>> oRun.CheckProcessExitCode()
>>> ELSE
>>> oRun.KillProc()
>>> mCount = 0
>>> endif
>>>ENDDO
>>>
>
>>You're running the release copy, as opposed to what I have here - try KillProc() rather than TerminateApp().
>
>In the Do While Loop, terminating the process after 3 attempts in about 5-10 seconds is not realistic - since it does take a while to computer. At times, the host computer many be busy - or at some point in time the transfer of files take a while. IOW what can i institute in place of waiting for 5-10 seconds before KillProc() kicks in. It would'nt be nice to introduce killProc() when pcAnywhere is transferring files. Any suggestions?
The Win32 API call Sleep comes to mind:
DECLARE Sleep IN WIN32API dwMillisecs
=Sleep(20000) && wait 20 seconds without giving control to VFP
>
>Thanks.