I would use an "interface" type in this situation.
In the unit's "interface" section define the interface type and a
function to create a new instance of the interface.
In the unit's implementation define all your classes including a class
that provides the interface. The implementation of
Anthony Walter wrote:
type
_PrivateData = class
private type THidden = record Name: string; end;
end;
... and later in the implementation section of the same unit ...
var H: _PrivateData.THidden; begin H.Name := 'Hello'; end;
But that will have the same problem of extra long
type
_PrivateData = class
private type THidden = record Name: string; end;
end;
... and later in the implementation section of the same unit ...
var H: _PrivateData.THidden; begin H.Name := 'Hello'; end;
___
fpc-pascal maillist -
On Thu, 7 Mar 2019, Dennis wrote:
unit frproxyserver;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Grids,
frBase;
type
TMyStringGrid=class(TStringGrid) //how to I make this class visible
only to this unit?
public
end;
Make stringgrid1 a pointer and put TMyStringGrid in the implementation
section?
Op do 7 mrt. 2019 om 09:11 schreef Dennis
> unit frproxyserver;
>
> {$mode objfpc}{$H+}
>
> interface
>
> uses
>Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Grids,
>frBase;
>
> type
>
>
unit frproxyserver;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Grids,
frBase;
type
TMyStringGrid=class(TStringGrid) //how to I make this class visible
only to this unit?
public
end;
{ TProxyServerFrame }