Restored from previous forum. Originally posted by marlo.
I need to write text to a created text file, to append more lines of text,i try with OpenFile(0,"mytext.txt") and then WriteString("my new text") , but only replace the text not append the text on new line, i test also with WriteStringN and the same thing.
Thanks for help.
from the ass of the world
Write text
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by freak.
Just add this line after the OpenFile() command:
Now every WriteString() command writes al the End
of the File.
Timo
--------------------------------
Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs and the universe trying to produce bigger and better idiots.
...So far, the universe is winning.
Just add this line after the OpenFile() command:
Code: Select all
FileSeek(Lof())
of the File.
Timo
--------------------------------
Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs and the universe trying to produce bigger and better idiots.
...So far, the universe is winning.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by ricardo.
OpenFile(0,"Myfile.txt)
FileSeek(Lof());Go to the end of the file
WriteString("my new text")
CloseFile(0)
Hola argentino !!Originally posted by marlo
I need to write text to a created text file, to append more lines of text,i try with OpenFile(0,"mytext.txt") and then WriteString("my new text") , but only replace the text not append the text on new line, i test also with WriteStringN and the same thing.
Thanks for help.
from the ass of the world
OpenFile(0,"Myfile.txt)
FileSeek(Lof());Go to the end of the file
WriteString("my new text")
CloseFile(0)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by PB.
Check out my small AddLine procedure at the following page, which uses
the concepts already explained by Ricardo/Freak above:
viewtopic.php?t=336
PB - Registered PureBasic Coder
Check out my small AddLine procedure at the following page, which uses
the concepts already explained by Ricardo/Freak above:
viewtopic.php?t=336
PB - Registered PureBasic Coder
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm