Hello Daniel:

Yes I have.  After considerably expermentation I found that the following
scheme worked very reliably when trying to copy a file from a CD-ROM and
then register it for processing it using MapBasic.


-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<
     ...

     Declare  Sub  Run_DOS_Command

     Dim DOS_Command as String

     Define DOS_Command_File "9"

     ...

     DOS_Command = "Dir    " + CD_ROM_Drive + ":\STF3" + STF_Table_Id
                             + "CA.DBF  " + Chr$(10)
                 + "xCopy  " + CD_ROM_Drive + ":\STF3" + STF_Table_Id
                             + "CA.DBF  " + STF_Source_Dir + Chr$(10)
                 + " Copy  CopyWait  CopyDone.Yes"
     Call Run_DOS_Command ()

     Do While True
         If FileExists("CopyDone.Yes") Then  Exit Do  End If
     Loop

     DOS_Command = "Del  CopyDone.Yes"
     Call Run_DOS_Command

     ...

Sub  Run_DOS_Command
'    ===============

     If FileExists("Prnt_Cmd.Yes")
     Then
         Print "Running DOS Command: " + Chr$(34) + DOS_Command + Chr$(34)
     End If

     Open File "DOS_Cmd.Bat"  For Output  As DOS_Command_File
     Print # DOS_Command_File, DOS_Command
     Print # DOS_Command_File, "If Exist Pause.Yes Pause"

     Close File DOS_Command_File

     Run Program "DOS_Cmd.Bat"
    
End Sub

-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<

Henry A. Mumm


>This is a multi-part message in MIME format.
>
>------=_NextPart_000_0042_01BE6AEA.A0EB0180
>Content-Type: text/plain;
>       charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>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.
>
>Thanks very much in advance for any help.
>
>
>Daniel Mack
>Cave Creek Systems
>Box 641 Nelson, B.C. V1L 5R4
>(250)352-3085
>[EMAIL PROTECTED]
>
>------=_NextPart_000_0042_01BE6AEA.A0EB0180
>Content-Type: text/html;
>       charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
><HTML>
><HEAD>
>
><META content=3Dtext/html;charset=3Diso-8859-1 =
>http-equiv=3DContent-Type>
><META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR>
></HEAD>
><BODY bgColor=3D#ffffff>
><DIV><FONT color=3D#000000 size=3D2>Hi everyone,</FONT></DIV>
><DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT size=3D2>Has anyone figured out how to run a DOS program from =
>within=20
>MapBasic and</FONT></DIV>
><DIV><FONT size=3D2>then successfully read a file created by the program =
>using the=20
>Register Table statement.</FONT></DIV>
><DIV><FONT size=3D2>I am having constant problems with the DOS program =
>not giving=20
>up the file before the Register Table statement executes. I have tried =
>using the=20
>&quot;set file timeout&quot; statement without success.</FONT></DIV>
><DIV><FONT size=3D2>I have also tried using a custom function (Wait) =
>that I wrote=20
>that accesses the system time and pauses the program execution. When =
>this=20
>function finishes, then the Register Table statement executes. =
>Unfortunately,=20
>the execution of the DOS program seems to be prolonged by the Wait =
>function and=20
>the file is still not available when the Register Table statement=20
>executes.</FONT></DIV>
><DIV><FONT size=3D2></FONT>&nbsp;</DIV>
><DIV><FONT size=3D2>Thanks very much in advance for any =
>help.</FONT></DIV>
><DIV>&nbsp;</DIV>
><DIV>&nbsp;</DIV>
><DIV><FONT color=3D#000000 size=3D2>Daniel Mack<BR>Cave Creek =
>Systems<BR>Box 641=20
>Nelson, B.C. V1L 5R4<BR>(250)352-3085<BR><A=20
>href=3D"mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</A></FONT></DIV></BOD=
>Y></HTML>
>
>------=_NextPart_000_0042_01BE6AEA.A0EB0180--
>
>----------------------------------------------------------------------
>To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
>"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]
>

%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
   Henry A. Mumm
   Sr. Programmer Analyst
   California Department of Conservation
   801 K Street, Ste 1921
   Sacramento, CA  95814
   [EMAIL PROTECTED]
   voice :: (916) 323-1360
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
         Conserve electrons
     Start recycling them today
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----------------------------------------------------------------------
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