Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to handle external program run ??
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00459666
Message ID:
00460278
Views:
14
>Hi!
>
>I think you have to put a while do loop that will check the output file...
>
>*******
>wait window "Please wait, creating back-up files...." NOWAIT
>run /n1 winrar a -o+ bb.rar
>do while !file("bb.rar")
>enddo
>wait window "Completed...."

It can be easier using API_APPRUN:
SET CLASSLIB TO Process ADDITIVE
oWinRar = CREATEOBJECT('api_apprun','winrar a -o+ bb.rar',,'MIN')  && run minimized
nSuccess = oWinRar.LaunchAppAndWait()
nExitCode = oWinRar.CheckProcessExitCode()
DO CASE
CASE nSuccess = 1
   wait window 'Finished - ' + transform(nExitCode)
CASE nExitCode = 259
   wait window 'Still running'
OTHERWISE
   wait window oWinRar.icErrorMessage + ' - ' + transform(nExitCode)
ENDCASE
Burns a lot fewer cycles, is interruptible, and access exit codes

>:
>:
>:
>
>--------> Your message
>
>Dear everybody,
>In my program, I write a backup/restore routine which utilize winrar as backup program.
>
>In my segment:
>
>:
>:
>run /n1 winrar a -o+ bb.rar .
>wait window "OKAY" nowait
>:
>:
>
>However, The program switch to next line, before the first line run completed.
>How can I program to do that the wait window preform after the run command completely done.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform