<div dir="ltr"><div>How about introducing a default parameter? <br>The parameter keeps the method backward compatible, allowing write a string without the prefix.<br><br>public procedure TStream.WriteAnsiString(<br> const S: string; <br>
withLength: Boolean = true;<br>);<br><br></div><div></div><div></div>thanks,<br>Dmitry<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 5:34 AM, Marco van de Voort <span dir="ltr"><<a href="mailto:marcov@stack.nl" target="_blank">marcov@stack.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In our previous episode, Sven Barth said:<br>
> > Do you think, that something similar can be added also in FPC ?<br>
><br>
> There is already a WriteAnsiString (<br>
> <a href="http://www.freepascal.org/docs-html/rtl/classes/tstream.writeansistring.html" target="_blank">http://www.freepascal.org/docs-html/rtl/classes/tstream.writeansistring.html</a><br>
> ) with the difference that it also writes out the length. Adding an<br>
> additional overload (especially with a name like WriteString) would IMHO be<br>
> confusing because of this.<br>
><br>
> Nothing stops you though from writing a class helper that adds a<br>
> WriteString method to TStream.<br>
<br>
(Except the fact that you can only have one class helper per class?)<br>
<br>
Maybe writebinansistring would be a good name.<br>
_______________________________________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
</blockquote></div><br></div>