Article View: pl.comp.lang.delphi
Article #334875Re: Class Helpers
From: jh
Date: Sun, 22 Jan 2012 12:59
Date: Sun, 22 Jan 2012 12:59
23 lines
1311 bytes
1311 bytes
TMyClassHelper = class helper for TStringList
public
function Add(const S: string): Integer;
end;
function TMyClassHelper.Add(const S: string): Integer;
begin
Showmessage('dodano string do listy');
Result := inherited Add(S); // Dodaj inherited
end;
var
ob: TStringList; // Nie TMyClassHelper
begin
ob:= TStringList.Create; // konstruktor klasy, nie helpera
ob.add('test 1');
ob.add('test 2');
ob.add('test 3');
showmessage(ob.text);
end;
jh
Technical Details
Message-ID:
<jfh17m$jl8$1@inews.gazeta.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mailReferences:
<jfgv2t$dd8$1@inews.gazeta.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail From: jh <no-email@sorry.com> Newsgroups: pl.comp.lang.delphi Subject: Re: Class Helpers Date: Sun, 22 Jan 2012 13:59:36 +0100 Organization: "Portal Gazeta.pl -> http://www.gazeta.pl" Lines: 23 Message-ID: <jfh17m$jl8$1@inews.gazeta.pl> References: <jfgv2t$dd8$1@inews.gazeta.pl> NNTP-Posting-Host: nat.netcity.pl Mime-Version: 1.0 X-Trace: inews.gazeta.pl 1327237174 20136 91.195.57.2 (22 Jan 2012 12:59:34 GMT) X-Complaints-To: usenet@agora.pl NNTP-Posting-Date: Sun, 22 Jan 2012 12:59:34 +0000 (UTC) X-User: jh0909nowe In-Reply-To: <jfgv2t$dd8$1@inews.gazeta.pl> User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit