forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


WAIT command won't wait!

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
NathanH
Valued Newbie


Joined: 05 Sep 2001
Posts: 32

PostPosted: Thu Jan 16, 2003 10:49 pm    Post subject: WAIT command won't wait! Reply with quote

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
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jan 16, 2003 10:54 pm    Post subject: Reply with quote

It works fine on XP Professional... It gives the INFO box after I close the
document. Wink

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
NathanH
Valued Newbie


Joined: 05 Sep 2001
Posts: 32

PostPosted: Thu Jan 16, 2003 11:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jan 16, 2003 11:08 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Thu Jan 16, 2003 11:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Jan 17, 2003 7:21 am    Post subject: Reply with quote

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
View user's profile Send private message
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Jan 17, 2003 1:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Fri Jan 17, 2003 2:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
NathanH
Valued Newbie


Joined: 05 Sep 2001
Posts: 32

PostPosted: Fri Jan 17, 2003 5:07 pm    Post subject: Reply with quote

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 Wink

Thanks again !

Nathan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group