Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Low-level files
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00558565
Message ID:
00558567
Vues:
18
This message has been marked as the solution to the initial question of the thread.
See fix in bold below. I would also recomend that you use STRTOFILE() function .
lcLogRecord = DTOS(DATE()) + '-' + TIME() + tcActionDesc + CHR(13) + CHR(10)
IF STRTOFILE(lcLogRecord, 'faxbol.log', .T.) = 0
   WAIT 'Cannot open or create output action log file' WINDOW NOWAIT
ENDIF
>I'm trying to create a "log" file of occurences within a system. I'm using FCREATE/FOPEN/FPUTS and can't get a new record created each time it is written. Is there a parameter that allows additional records to be added to a text file opened with FOPEN? The code is as follows:
>
>IF FILE('faxbol.log')
>  lnActionFile = FOPEN('faxbol.log',12)
>ELSE
>  lnActionFile = FCREATE('faxbol.log')
>ENDIF
>IF lnActionFile < 0
>  WAIT 'Cannot open or create output action log file' WINDOW NOWAIT
>ELSE
   <b>= FSEEK(lnActionFile, 0,2)</b>    && Move pointer to the end of the file
>  =FPUTS(lnActionFile, DTOS(DATE()) + '-' + TIME() + tcActionDesc)
>ENDIF
>=FCLOSE(lnActionFile)
>
>Thanks in advance,
>
>Harry
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform