Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dropping File on EXE causes STRTOFILE() to Fail
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Dropping File on EXE causes STRTOFILE() to Fail
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00968029
Message ID:
00968029
Vues:
55
Hi all,

I have a small app (one prg) with an LPARAMETERS statement at the begining of it. The idea is to accept a file name as an input parameter. The app issues a STRTOFILE() (to a different file from the input) in a few places in the code. If I run the exe from Windows Explorer (or the Run dialog) without a parameter, the app runs and writes to the output file via STRTOFILE() just fine stating that an invalid file was passed. If I run the app from within the VFP IDE or the Windows Run dialog with a parameter, all runs well. BUT, if I drag a file onto the exe, the app runs fine, processing the input file, but doesn't write the output via STRTOFILE() (or FOPEN(), FPUTS(), FCLOSE(), etc.) and no error is returned. In fact, if I check the return value of STRTOFILE() or FPUTS(), they both return the number of bytes they should have written. It's like dropping a file onto the exe locks the I/O buffer in Windows or something. I've even tried issuing a CLOSE ALL within the application to try to force that lock off.

Has anyone else seen this? Any ideas? Other than just to not drag and drop a file onto the exe...

Without testing this code, I'd bet this will show what I'm talking about. Just put this in a PRG and compile it into an EXE and run it various ways:
LPARAMETERS tcInput AS String

STRTOFILE(TRANSFORM(DATETIME() + ' - ' + TRANSFORM(tcInput) + CHR(13) + CHR(10), 'Output.txt', 1)
TIA,
_________________________________
There are 2 types of people in the world:
    Those who need closure
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform