On 14.04.2016 19:36, leledumbo wrote:
>> Is there any chance to add a class like Delphi's TStringBuilder to FCL? It
> would be very useful to port Delphi code libraries to Free Pascal.
> 
> That exists mainly to overcome the read-only, 0-based string implementation
> limitations in Delphi NextGen, doesn't it? Porting will still require
> 0-based string implementation, that class implementation alone won't be
> enough.

We already have zero based strings in 3.0.0 if {$ZeroBasedStrings On} is
used (it's a local switch). It works with Ansi-, Wide- and
UnicodeString, but not with ShortString.

The following example will print

=== output begin ===
l
o
=== output end ===

=== code begin ===

program tzerostr;

{$H+}

var
  s: String;
begin
  s := 'Hello World';
  Writeln(s[4]);
{$ZeroBasedStrings On}
  Writeln(s[4]);
end.

=== code end ===

Regards,
Sven

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to