Hello Fred and PB-team
#PB_Append into Openfile() for set read/write pointer position for beginning opfenfile to end of File?
[Implemented] For OpenFile() a new parmeter #PB_Append?
-
- Addict
- Posts: 4777
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
I do support this request. Reasons:
a) Such a feature is useful and not seldom needed.
b) People who have previously used another programming language probably know such a feature, and are confused when they don't find it in PB. This also means, that offering this feature would make it easier for programmers to switch from another language to PB.
c) Although we can implement this functionality ourselves, beginners can *not* do so.
Regards, Little John
a) Such a feature is useful and not seldom needed.
b) People who have previously used another programming language probably know such a feature, and are confused when they don't find it in PB. This also means, that offering this feature would make it easier for programmers to switch from another language to PB.
c) Although we can implement this functionality ourselves, beginners can *not* do so.
Regards, Little John
-
- Enthusiast
- Posts: 796
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: For OpenFile() a new parmeter #PB_Append?
I also support this request. For my latest Application, I needed to append dataFalko wrote:Hello Fred and PB-team
#PB_Append into Openfile() for set read/write pointer position for beginning opfenfile to end of File?
to an existing file. I use FileSeek(0, LoF(0)) at the moment... Should be
possible without a second line of code, I think.
Regards,
JamiroKwai
JamiroKwai
Re: For OpenFile() a new parmeter #PB_Append?
> FileSeek(0, LoF(0))
You can always create a new macro command made up of OpenFile and
FileSeek(0, LoF(0)) after it, make it a resident, then the new command will
always be available when you run PureBasic without any extra typing at all.
The new command could be named something like AppendFile(#num,name$).
Oh damn, I think I even further dissuaded the team from doing it now.
(For the record, I've love an append flag too).
You can always create a new macro command made up of OpenFile and
FileSeek(0, LoF(0)) after it, make it a resident, then the new command will
always be available when you run PureBasic without any extra typing at all.
The new command could be named something like AppendFile(#num,name$).
Oh damn, I think I even further dissuaded the team from doing it now.

(For the record, I've love an append flag too).
Last edited by PB on Thu Jul 24, 2008 10:30 am, edited 1 time in total.
-
- Addict
- Posts: 4777
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
Re: For OpenFile() a new parmeter #PB_Append?
CreateFile() will delete any existing file. This certainly is not wanted, when someone intends to append stuff to an existing file.PB wrote:> FileSeek(0, LoF(0))
You can always create a new macro command made up of CreateFile and
FileSeek(0, LoF(0)) after it,
Writing a macro as suggested is not easy for new users of PB, and -- as you demonstrated

Regards, Little John
Re: For OpenFile() a new parmeter #PB_Append?
> CreateFile() will delete any existing file
Ah, that was just a typo. Of course I meant OpenFile. I've edited my post.
Ah, that was just a typo. Of course I meant OpenFile. I've edited my post.
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
-
- Addict
- Posts: 4777
- Joined: Thu Jun 07, 2007 3:25 pm
- Location: Berlin, Germany
I think the team members can decide that themselves. In any case, this sub-forum is for posting wishes, no?Kaeru Gaman wrote:I think the Team has more relevant things to do than caring about such peepee....
From a current thread in the German forum, where both you and me participate, we know that this seems to be too hard for some beginners. And in the proposed functionality, there is no magic involved. It is standard in several other languages. I already wrote above, why implementing standard features can be advantageous also for Fantaisie Software themselves.Kaeru Gaman wrote:In my eyey, it's better to let a beginner see what is necessary to append to a file
than let him believe you could magically open a file with the pointer at the end.
Regards, Little John