Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Software Log File
Message
From
27/04/2007 08:24:41
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01220348
Message ID:
01220390
Views:
39
Dear Sir,

I wrote following
local lnI,csno,cuser,cdate,ctime,cstr, nbytes,cuser2,cdate2,ctime2,cstr2, nbytes2
&& To findout last serial number
lcText = FILETOSTR("c:\myfile.txt")
lnLines = ALINES(aTextLines,lcText,.T.)	
FOR lnI = 1 TO lnLines
ENDFOR

&& this procedure is starup prg
csno=lnI  					&& last serial number+1
cuser=ALLTRIM(STR(RAND()*10))&& user name
cdate=DTOC(DATE()) 			&& date
ctime=TIME() 				&& time
cstr=ALLTRIM(STR(csno))+CHR(9)+ALLTRIM('user')+cuser+CHR(9)+cdate+CHR(9)+ctime
nbytes = strtofile(cstr+ chr(13) + chr(10),+"c:\myfile.txt",1)

&& this procedure runs when exe stopped
cuser2=ALLTRIM(STR(RAND()*10))
cdate2=DTOC(DATE()) 			
ctime2=TIME() 				
cstr2=ALLTRIM('user')+cuser2+CHR(9)+cdate2+CHR(9)+ctime2
nbytes2 = strtofile(cstr2, "c:\myfile.txt",1)
I want to add cstr2 at the end to then last line instead of new line
How to findout last line of myfile.txt and add specific data at the end of last line?

Please help
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform