It is currently Sun Aug 25, 2019 5:31 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Alternative AddLine (append) for text files
PostPosted: Fri Nov 30, 2001 8:31 pm 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Code updated for 5.20+

Restored from previous forum. Originally posted by PB.

This is my version of an AddLine (append) procedure for text files.

Code:
Procedure AddLine(file$,line$)
  s.q=FileSize(file$) : If s=-1 : s=0 : EndIf
  f=OpenFile(#PB_Any,file$)
  If f : FileSeek(f,s) : WriteStringN(f,line$) : CloseFile(f) : EndIf
  If FileSize(file$)<>s : ok=1 : EndIf
  ProcedureReturn ok
EndProcedure

Debug AddLine("e:\test.txt","hello!")


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye