Re: [fpc-devel] Method for write string into TStreamt

2014-07-21 Thread Marco van de Voort
In our previous episode, Sven Barth said: > > Do you think, that something similar can be added also in FPC ? > > There is already a WriteAnsiString ( > http://www.freepascal.org/docs-html/rtl/classes/tstream.writeansistring.html > ) with the difference that it also writes out the length. Adding a

Re: [fpc-devel] Method for write string into TStreamt

2014-07-21 Thread Dmitry Boyarintsev
How about introducing a default parameter? The parameter keeps the method backward compatible, allowing write a string without the prefix. public procedure TStream.WriteAnsiString( const S: string; withLength: Boolean = true; ); thanks, Dmitry On Mon, Jul 21, 2014 at 5:34 AM, Marco van de V

Re: [fpc-devel] Method for write string into TStreamt

2014-07-21 Thread Sven Barth
Am 21.07.2014 11:34 schrieb "Marco van de Voort" : > > In our previous episode, Sven Barth said: > > > Do you think, that something similar can be added also in FPC ? > > > > There is already a WriteAnsiString ( > > http://www.freepascal.org/docs-html/rtl/classes/tstream.writeansistring.html > > )

Re: [fpc-devel] Method for write string into TStreamt

2014-07-21 Thread Hans-Peter Diettrich
Dmitry Boyarintsev schrieb: How about introducing a default parameter? The parameter keeps the method backward compatible, allowing write a string without the prefix. public procedure TStream.WriteAnsiString( const S: string; withLength: Boolean = true; How should a string without a leng

Re: [fpc-devel] Method for write string into TStreamt

2014-07-22 Thread tha...@thaddy.com
A case for ternary computing is not really a bad idea ;) On 21-7-2014 21:42, Hans-Peter Diettrich wrote: Dmitry Boyarintsev schrieb: How about introducing a default parameter? The parameter keeps the method backward compatible, allowing write a string without the prefix. public procedure TSt

Re: [fpc-devel] Method for write string into TStreamt

2014-07-22 Thread Dmitry Boyarintsev
On Tue, Jul 22, 2014 at 6:46 AM, tha...@thaddy.com wrote: > A case for ternary computing is not really a bad idea ;) > > On 21-7-2014 21:42, Hans-Peter Diettrich wrote: > >> Dmitry Boyarintsev schrieb: >> >> How about introducing a default parameter? >>> The parameter keeps the method backward c

Re: [fpc-devel] Method for write string into TStreamt

2014-07-22 Thread tha...@thaddy.com
What I was a little bit more than hinting at in my previous answers is that it is impossible for an abstract read stream to know that there's a string to read. There is at least one higher level of implementation necessary: one that recognizes a string. That means probably something like storin

Re: [fpc-devel] Method for write string into TStreamt

2014-07-22 Thread Dmitry Boyarintsev
On Tue, Jul 22, 2014 at 12:17 PM, tha...@thaddy.com wrote: > What I was a little bit more than hinting at in my previous answers is > that it is impossible for an abstract read stream to know that there's a > string to read. There is at least one higher level of implementation > necessary: one t