Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ed Rauh's LaunchAppAndWait
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00382207
Message ID:
00382245
Vues:
19
>>>Ed (or anyone else that might know). I am trying to implement this API to delete some files before moving on. Is it possible to call the internal DEL command using this API? In the comments it says can start any DOS or Winows executeable. Since DEL isn't an executeable (or .com) file does this make a difference?
>>>
>>>Right now I am passing the parameters:
>>>
>>>tcCommandLine = del c:\temp\mr*.*
>>>tuFromDir=0 (I am guessing this is the directory where the executeable is supposed to exist?)
>>>tcWindowMode='HIDE'
>>>
>>>TIA for any help.
>>>
>>George,
>>
>>DEL is actually a function of Command.com. However, VFP has commands to do this, as does the Windows Script Host. Exactly what do you need to do that either of these can't?
>
>George,
>I have a table that contains reports and the code required to set up the environment for these reports. When a report is run I copy the setup code and the report .frx and .frt from memo fields to the temp drive:\folder and execute them. A majority of the time FoxPro thinks that the compiled version of the program that I have copied out is newer than the actual .prg file and so uses that instead. It causes major headaches because the same data environment is set up over and over again.
>
>So, to eliminate this I delete these files prior to running the code to export the report. Problem is VFP doesn't seem to notice that the files have been deleted if I used the internal VFP 'DELETE FILE' command. Then I decided just to run a DOS delete. This works great but pops up a DOS box that is not quite as attractive as I would like <grin>. Finally found Ed's and hoped it would do this deletion 'behind the scenes'.
>
>I thought of WSH but we have a lot of machines that are still running Win 3.11 (I know, ridiculous) and other odd configurations so I can't be sure the WSH will be available.
>
>I guess I can create a batch file on the fly and use the run command with the DOS box minimized...was just hoping to use something a little more elegant.


This is a SWAG, George, but (at least in my mind) it makes sense. I think what you're seeing is Fox referencing its internal program buffer. Therefore, I don't think that whatever you're using to delete the file will make one bit of difference. Try issuing: CLEAR PROGRAM, to clear the program buffer and see if that does the trick.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform