Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Software Log File
Message
De
27/04/2007 08:24:41
 
 
À
27/04/2007 06:15:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01220348
Message ID:
01220390
Vues:
30
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform