Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FOPEN() returns 0
Message
De
27/09/2004 11:56:20
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00946247
Message ID:
00946302
Vues:
23
Okay, David
I ran the display status just before fopening the file and just after closing it in code. It did not show as a user opened file in the first one. In the 2nd one, it showed as a file open with a handle of 0 and a length of 0.

Arror() gets me nothing, because it is not reporting it as an error.

This is a random occurance, because once on friday and now I can get it to run correctly. I have shut down the machine several times trying to correct this problem. It did not fix it. But messing with the program in debug mode getting the problem fixed.
>Beth,
>
>you can call aerror() to get more info.
>
>I suspect the file is already open by an earlier run of your code without a call to fclose() in between. A DISPLAY STATUS will show you if you have the file open already.
>
>>Hi, all
>> I am working in VFP8.
>> I have some code that is suppose to open a plain ascii file in read-only buffered mode (default mode) and find out if the file has something in it.
>>
>>ctmpfile = ALLTRIM(cConPath + "Service.cfg")
>>STORE FOPEN(ALLTRIM(ctmpfile)) TO lnFileHandle
>>STORE FSEEK(lnFileHandle,0,2) TO lnEnd
>>STORE FSEEK(lnFileHandle,0) TO lnTop
>>STORE FSEEK(lnFileHandle,0,1) TO lnCurrent
>>
>>
>>lnFileHandle comes back as 0 (zero) not -1 or 1. If I set code before this to be sure that the file is there, it comes back true. But the lnFileHandle still is set to 0.
>>Can anyone help me fix this problem??
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform