🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.documentation
Article #150

Re: Turbo Delphi - String Splitting - related to the help and documentation

#150
From: Robert MacMillan
Date: Tue, 31 Jul 2007 02:56
25 lines
2076 bytes
DJSox wrote:
> Hi Robert,
>     Try replacing your:    ExtractStrings([','],[],Dataln,Contents1) with 
> ExtractStrings([','],[],PChar(Dataln),Contents1) ;
> 
> Also, the stringlist you create needs to be freed when you are done, by 
> calling Contents1.free, when you are through using it.
> 
> The function requires a null terminated(c-style) string, and you are using a 
> Delphi style string. Luckily, Delphi strings can simply be cast to null 
> terminated strings directly with PChar().
> 
> Dan
> 
> 
Dan

Thank you for the help. Yep that fixed the problem in one quick easy 
lesson.

Perhaps I am struggling because the documentation assumes that one is 
fluent in nuances like the one above however while there are many 
features of Turbo Delphi that I like the learning experience is slow and 
very very painful. Mnay many hours wasted searching for a solution to 
this particular simple and common requirement before I asked here.
Technical Details
Message-ID: <46aea4cd@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46ad51f8$1@newsgroups.borland.com> <46ad6a43$1@newsgroups.borland.com> <46add1a3$1@newsgroups.borland.com> <46adf46c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10a202,9e8c64573cb861fd
X-Google-Attributes: gid10a202,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 31 Jul 2007 12:56:18 +1000
From: Robert MacMillan <macfam@bigpond.net.au>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.delphi.documentation
Subject: Re: Turbo Delphi - String Splitting - related to the help and documentation
References: <46ad51f8$1@newsgroups.borland.com> <46ad6a43$1@newsgroups.borland.com> <46add1a3$1@newsgroups.borland.com> <46adf46c$1@newsgroups.borland.com>
In-Reply-To: <46adf46c$1@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 58.175.188.72
Message-ID: <46aea4cd@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1185850573 58.175.188.72 (30 Jul 2007 19:56:13 -0700)
Lines: 25
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail