Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Just Created output file shows up 30 seconds later

Status
Not open for further replies.

TJay

Programmer
Nov 25, 1998
14
0
0
US
I've created a VB6 program without any forms.
The program's properties is set to start with sub main rather than a form at startup. I then run this program in a MS-DOS prompt window.
The program reads several input files and outputs a single file. It works fine EXCEPT the program returns me to the DOS prompt like it is finished BUT it is at least 30 seconds later before the file shows up using the DIR command of DOS.

I have a batch program that runs this program and then immediately after it's done runs another program that reads the output of the first program, which DOESN'T find the file because it is 30 seconds late.

Any ideas/options?
 
Cache write-through or write-behind? I think may be the culprit, but I could be wrong. These are the only things I can think of:

In VB code: Just before exiting, create a small bit of code that reads the file and then exits the prg. (It may help speed things up by committing the action of file writing..not sure though, but worth a try)

example:

sub form_unload/exit ()
dim a as string
open "thisfile" for input as #100
input #100, a
close #100
end
end sub


in BAT file: you can try using the CHOICE command...if your DOS ver has it (at prompt type CHOICE /? for the syntax) you will note that it allows for a set time limit before it uses the default key (at which point) and continues with the processes.

Example:
(runs your VB app)
choice /t:a,30 Attempting access to data, please wait...
(rest of your code)


Hopefully one of these (or a combo of both) will help producing the end result. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top