Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 8th, 2006, 5:37 PM   #1
chepfaust
Programmer
 
chepfaust's Avatar
 
Join Date: Feb 2005
Posts: 62
Rep Power: 4 chepfaust is on a distinguished road
[VB6] shell() timing issues

i have a small problem concerning timing the execution of a shell() command and the manipulation of its output.

here is a nutshell version of my code:

(1) user inputs parameters
(2) batch file is created based on parameters (the batch file, when run, creates a separate text file)
(3) shell(batch file)
(4) text file is opened and contents parsed

based on the contents of that outputted text file, i have reason to believe that VB is flying through the commands and executing (4) before the shell (3) has finished doing everything it's supposed to do.

is there any way to make VB wait for termination of the shell before continuing execution of the program?

thanks
chepfaust is offline   Reply With Quote
Old May 8th, 2006, 6:12 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Use the Sleep function. For example, the following code will cause the program to wait for one second, or one thousand milliseconds, before executing the next command.
Sleep 1000
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:00 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC