Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2017-08

TStringHelper missing

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Ryan Joseph
Ryan Joseph wrote 12 lines
I’m trying to split a string by a delimiter and see there is a type helper called TStringHelper (https://www.freepascal.org/docs-html/rtl/sysutils/tstringhelper.html). The compiler version I’m using is "Free Pascal Compiler version 3.1.1 [2017/04/22] for i386” but when I include SysUtils the methods are not found. For example: var str: string; parts: TStringArray; parts := str.Split(' ‘); What am I doing wrong?
Try
var
   Str : AnsiString;
or
   Str : WideString;

I believe the compiler has some trouble finding the helper if you use the 'string' alias. I think there is even a bugreport about it. Sven Barth can confirm/deny this.

Michael.

Reply by email

Sven Barth
"Michael Van Canneyt" wrote 6 lines
On Mon, 21 Aug 2017, Ryan Joseph wrote: > I’m trying to split a string by a delimiter and see there is a type

helper called TStringHelper (
https://www.freepascal.org/docs-html/rtl/sysutils/tstringhelper.html). The compiler version I’m using is "Free Pascal Compiler version 3.1.1 [2017/04/22] for i386” but when I include SysUtils the methods are not found.

Show quoted text 23 lines
> > For example: > > var > str: string; > parts: TStringArray; > > parts := str.Split(' ‘); > > > What am I doing wrong? Try var Str : AnsiString; or Str : WideString; I believe the compiler has some trouble finding the helper if you use the 'string' alias. I think there is even a bugreport about it. Sven Barth can confirm/deny this.

I thought that was fixed? Except of course if $H- is used (which is the default in all modes except the Delphi ones) cause then String = AnsiString.

Regards,
Sven

Reply by email

Sven Barth
to Sven Barth
"Sven Barth" wrote 9 lines
Am 21.08.2017 08:23 schrieb "Michael Van Canneyt" < : > > > > On Mon, 21 Aug 2017, Ryan Joseph wrote: > >> I’m trying to split a string by a delimiter and see there is a type

helper called TStringHelper (
https://www.freepascal.org/docs-html/rtl/sysutils/tstringhelper.html). The compiler version I’m using is "Free Pascal Compiler version 3.1.1 [2017/04/22] for i386” but when I include SysUtils the methods are not found.

Show quoted text 21 lines
>> >> For example: >> >> var >> str: string; >> parts: TStringArray; >> >> parts := str.Split(' ‘); >> >> >> What am I doing wrong? > > > Try > > var > Str : AnsiString; > or > Str : WideString; > > I believe the compiler has some trouble finding the helper if you use

the

> 'string' alias. I think there is even a bugreport about it. > Sven Barth can confirm/deny this. I thought that was fixed? Except of course if $H- is used (which is the

default in all modes except the Delphi ones) cause then String = AnsiString.

String = ShortString in case of $H- of course -.-

Regards,
Sven

Reply by email