Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP60- Low Level Functions
Message
From
18/10/1999 13:55:14
 
 
To
18/10/1999 13:46:13
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00277764
Message ID:
00277773
Views:
23
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
Previous
Reply
Map
View

Click here to load this message in the networking platform