| View previous topic :: View next topic |
| Author |
Message |
NathanH Valued Newbie
Joined: 05 Sep 2001 Posts: 32
|
Posted: Thu Jan 16, 2003 10:49 pm Post subject: WAIT command won't wait! |
|
|
Hi,
I'm opening a Access database using the SHELL command with a WAIT parameter, which works fine until another Access database is running, in which case the WAIT is ignored. The same thing happens with a Word Doc.
| Code: |
SHELL OPEN,C:\test.doc,,,WAIT
INFO Continue with code...
|
If Word is open then the code opens test.doc and does NOT wait...
Any way around this??
Thanks everyone!
Nathan |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jan 16, 2003 10:54 pm Post subject: |
|
|
It works fine on XP Professional... It gives the INFO box after I close the
document.  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
NathanH Valued Newbie
Joined: 05 Sep 2001 Posts: 32
|
Posted: Thu Jan 16, 2003 11:02 pm Post subject: |
|
|
FreezingFire,
Yes, I'm using XP Pro as well, with Office 2000. It works fine as long as Word is not ALREADY open. Try opening a blank word document and then running the code. On mine the INFO box appears as soon as opens the document. It's like VDS can see that didn't OPEN Word, as it was already running, so it doesn't bother to wait and CLOSE it...
Nathan |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jan 16, 2003 11:08 pm Post subject: |
|
|
Looks like a possible bug, but probably cannot be fixed within VDS. I
believe it's more of a Windows problem.
You can close all of the Word windows before doing this though...
| Code: |
REM -- For VDS 4.0 and up... --
while @winexists(#OpusApp)
window close,#OpusApp
wend
REM -- For VDS 3.51 and below --
repeat
window close,#OpusApp
until @not(@winexists(#OpusApp)) |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Thu Jan 16, 2003 11:10 pm Post subject: |
|
|
Not sure if this will help but you could try variations of the following code to
see if it would work.
| Code: | window hide,#OpusApp
shell open,C:\test.doc,,,WAIT
INFO Continue
Window Normal,#OpusApp |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Jan 17, 2003 7:21 am Post subject: |
|
|
Obviously VDS has a problem when other instances of the program to be launched are already
started. Or when another instance is opened while your original window is still there! It does not
distinguish between various instances of the same program.
You could try a workaround like this:
| Code: |
option decimalsep,"."
%%filepath = C:\test.doc
%%worddoc = @name(%%filepath).@ext(%%filepath)
SHELL OPEN,%%filepath
REM Now wait for the Word window to open
repeat
wait .2
until @winexists(%%worddoc - Microsoft Word)
%%close = 0
repeat
if @not(@winexists(%%worddoc - Microsoft Word))
wait .2
%%close = 1
end
until @equal(%%close,1)
INFO Continue with code...
|
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Jan 17, 2003 1:46 pm Post subject: |
|
|
Dr. Dread,
Actually it is not VDS here. You are calling the windows Shell... You could look up the registry association of *.doc files and run the program explcitly. I don't have time now but later I will post you some code to do this. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Jan 17, 2003 2:07 pm Post subject: |
|
|
| mindpower wrote: | Dr. Dread,
Actually it is not VDS here. You are calling the windows Shell... You could look up the registry association of *.doc files and run the program explcitly. I don't have time now but later I will post you some code to do this. |
Hey Mindpower!
Do you mean something like:
| Code: |
%%word = @REGREAD(LOCAL,SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe)
RUN %%word C:\TEST.DOC,WAIT
INFO Continue with code...
|
In that case the problem remains: VDS does not distinguish between different instances of
the program. If a Word window is already open, VDS continues the code sequence. And if you
open another instance of Word while TEST.doc is open, VDS will not continue the code sequence
even if the TEST.doc window is closed.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
NathanH Valued Newbie
Joined: 05 Sep 2001 Posts: 32
|
Posted: Fri Jan 17, 2003 5:07 pm Post subject: |
|
|
Thanks for the info guys,
I actually had thought of pulling the exe path from the reg and calling the app directly, but testing showed the same problem would occur, even when using the RUN command. For my purposes, using the REPEAT / UNTIL command, as suggested by Dr. Dread, serves my purposes well enough. Just don't like putting in extra code when the one parameter should handle it
Thanks again !
Nathan |
|
| Back to top |
|
 |
|