Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP60- Low Level Functions
Message
De
18/10/1999 13:55:14
 
 
À
18/10/1999 13:46:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00277764
Message ID:
00277773
Vues:
24
Since there is no real insert, I guess the best you could do would be to create a new file for the current entry, append the previous file and do the appropriate deleting and renaming.

Rick

>I would like to append data to my LOG.TXT file at the begining of the file not at the end. Is there a way of doing that with low level functions? The following is the function I have for now but this let me add data at the bottom of the log file.
>
>Any suggestions on how to add data at the begining of the file? Thank you in advance.
>
>FUNCTION writeit()
>PARAMETER cdt
>cdt = cdt + TIME() + " " + DTOC(DATE())
>IF FILE('log.txt') && Does file exist?
>nlogfile = FOPEN('log.txt',12) && If so, open read-write
>ELSE
>nlogfile = FCREATE('log.txt') && If not, create it
>ENDIF
>IF nlogfile < 0 && Check for error opening file
>WAIT 'Cannot open or create output file' WINDOW NOWAIT
>ELSE && If no error, write to file
>FSEEK(nlogfile,0,2)
>FPUTS(nlogfile,cdt)
>FCLOSE(nlogfile)
>ENDIF
>RETURN
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform