Just starting out? Need help? Post your questions and find answers here.
debaser
New User
Posts: 7 Joined: Tue May 10, 2005 1:59 pm
Post
by debaser » Tue Jun 07, 2005 2:32 pm
well
my application is a notepad that should add to a text file (*.txt) the new comments i write.
i just have a text editor and a "save" button. when i push save it has to add the new text to a specified txt file.
Code: Select all
OpenFile(0, "appunti.txt")
WriteString(String$)
CloseFile(0)
with this code it overwrites everytime the first line....
[/code]
sec
Enthusiast
Posts: 792 Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:
Post
by sec » Tue Jun 07, 2005 2:36 pm
Code: Select all
OpenFile(0, "appunti.txt")
Fileseek(lof())
WriteString(String$)
CloseFile(0)
Correct it! thanks D*
Last edited by
sec on Tue Jun 07, 2005 2:52 pm, edited 1 time in total.
Dare2
Moderator
Posts: 3321 Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land
Post
by Dare2 » Tue Jun 07, 2005 2:40 pm
Code: Select all
If OpenFile(#_file, "outdoc.txt")
FileSeek(lof())
WriteStringN("<< APPENDED >>")
CloseFile(#_file)
EndIf
Whup - slow typer. As Sec showed.
Last edited by
Dare2 on Tue Jun 07, 2005 2:41 pm, edited 1 time in total.
@}--`--,-- A rose by any other name ..
Doobrey
Enthusiast
Posts: 218 Joined: Sat Apr 26, 2003 4:47 am
Location: Dullsville..population: me
Contact:
Post
by Doobrey » Tue Jun 07, 2005 2:40 pm
Shouldn't it be FileSeek(Lof()) instead of FileSeek(Eof())?
Edit.. beaten to it by Dare2 :roll:
sec
Enthusiast
Posts: 792 Joined: Sat Aug 09, 2003 3:13 am
Location: 90-61-92 // EU or ASIA
Contact:
Post
by sec » Tue Jun 07, 2005 2:50 pm
Doobrey wrote: Shouldn't it be FileSeek(Lof()) instead of FileSeek(Eof())?
Edit.. beaten to it by Dare2 :roll:
my typo .
Dare2
Moderator
Posts: 3321 Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land
Post
by Dare2 » Tue Jun 07, 2005 2:56 pm
It's a three-way tie!
@}--`--,-- A rose by any other name ..
Doobrey
Enthusiast
Posts: 218 Joined: Sat Apr 26, 2003 4:47 am
Location: Dullsville..population: me
Contact:
Post
by Doobrey » Tue Jun 07, 2005 5:30 pm
Dare2 wrote: It's a three-way tie!
OK, deathmatch it is then ...
Or would you prefer rock,paper,scissors ?
Dare2
Moderator
Posts: 3321 Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land
Post
by Dare2 » Tue Jun 07, 2005 5:49 pm
rofl.
paper!
@}--`--,-- A rose by any other name ..
PB
PureBasic Expert
Posts: 7581 Joined: Fri Apr 25, 2003 5:24 pm
Post
by PB » Tue Jun 07, 2005 9:40 pm
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.