At 11:39 AM 03/10/1999 -0800, Daniel Mack wrote:
>Hi everyone,
>
>Has anyone figured out how to run a DOS program from within MapBasic and
>then successfully read a file created by the program using the Register 
>Table statement.
>I am having constant problems with the DOS program not giving up the file 
>before the Register Table statement executes. I have tried using the "set 
>file timeout" statement without success.
>I have also tried using a custom function (Wait) that I wrote that 
>accesses the system time and pauses the program execution. When this 
>function finishes, then the Register Table statement executes. 
>Unfortunately, the execution of the DOS program seems to be prolonged by 
>the Wait function and the file is still not available when the Register 
>Table statement executes.
>

I've tried to do this with a DO...LOOP checking for the existence of a 
certain filename. Since a DOS process creates the filename as soon as the 
file is opened for writing, you don't want to look for that file. Instead, 
have your DOS program run as part of a batch, where the last line is a COPY 
function that copies the result file to a path\filename your MapBasic 
program is looking for. To be safe, maybe put a pause at the end of the 
LOOP based on the size of the file to make sure the copy is completed.

This is not the most elegant solution, but it works.




Steve Wallace
GIS & Market Information Manager
Florida Farm Bureau Insurance Companies

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to