🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.pascal
2 messages
2 total messages Started by webmajsterek@poc Thu, 01 Sep 2011 09:51
przeci��anie property
#89818
Author: webmajsterek@poc
Date: Thu, 01 Sep 2011 09:51
19 lines
719 bytes
czy jest jaka� mo�liwo�� przeci��ania property ??
chcia�em co� takiego zrobi�

 TListMemory=class(TStringList)
        function Get(Index: Integer): TMemoryStream;overload;
        function Get(Index: Integer): String;reintroduce;overload;
        procedure Put(Index: Integer; Item: TMemoryStream);overload;
        procedure Put(Index: Integer; Item: String);reintroduce;overload;
     public
        property Items[Index: Integer]: TMemoryStream read Get write Put;
        property Items[Index: Integer]: String Read Get Write Put;default;
  End;

a tu kompilator   w  ka�dej lini zwraca b��d ze tak nie mo�na przeci��a� .

--
Wys�ano z serwisu OnetNiusy: http://niusy.onet.pl

Re: =?ISO-8859-2?Q?przeci±¿anie_property?
#89819
Author: Grzegorz Skoczyl
Date: Thu, 01 Sep 2011 11:40
35 lines
1396 bytes
W dniu 2011-09-01 09:51, webmajsterek@poczta.onet.pl pisze:
>
> czy jest jaka� mo�liwo�� przeci��ania property ??
> chcia�em co� takiego zrobi�
>
>   TListMemory=class(TStringList)
>          function Get(Index: Integer): TMemoryStream;overload;
>          function Get(Index: Integer): String;reintroduce;overload;
>          procedure Put(Index: Integer; Item: TMemoryStream);overload;
>          procedure Put(Index: Integer; Item: String);reintroduce;overload;
>       public
>          property Items[Index: Integer]: TMemoryStream read Get write Put;
>          property Items[Index: Integer]: String Read Get Write Put;default;
>    End;
>
> a tu kompilator   w  ka�dej lini zwraca b��d ze tak nie mo�na przeci��a� .

To nie przejdzie - w ka�dym razie nie przejdzie w Delphi (na pewno do
wersji 2007; p�niejszych jeszcze nie mam). Problem dotyczy
zdefiniowania funkcji "Get". W Delphi prze�adowane funkcje musz� r�ni�
si� parametrami. R�nica tylko w typie wyniku funkcji nie jest
wystarczaj�ca. Mo�na to obej�� zmieniaj�c nazwy tych funkcji, na
przyk�ad na "GetMem" i "GetStr".

Drugi problem dotyczy w�a�ciwo�ci. Delphi, a przynajmniej wersje do
2007, nie pozwala na prze�adowanie w�a�ciwo�ci.


--
Pozdrawiam,

Grzegorz Skoczylas
http://gskoczylas.rekord.pl
----------------------------------------------

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads