&& time limit is 10 minutes in milliseconds
#DEFINE NN_TIMELIMIT 600000
declare integer Sleep in Win32API integer
run /n1 winrar a -o+ bb.rar .
wait window "OKAY" nowait
local lnHandle, nTimeLimit
m.lnHandle = 0
m.nTimeLimit = 0
m.lnHandle = FOPEN("bb.rar",12)
do while m.lnHandle<=0 AND m.nTimeLimitSleep(1000) && give processor resources to system
m.nTimeLimit = m.nTimeLimit + 1000
edndo
if m.lnHandle>0 && close file if it is opened
fclose(m.lnHandle)
endif
The idea in above code - loop until file made by ara is available for opening (closed by rar). When certain time passed, we finish loop to avoid hanging up when potential problems occurred in the RUN command (for example, disk full - no file produced). You can adjust this limitation to be appropriate to you needs. I used 1 second (1000 constant in code) for checkpoints. If your server is slow, FOPEN command might work more slowly than 1 second. In such case you need to increase this constant.
>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.
>
>
>Yours faithfully,
>
>SOVlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.