Re: [fpc-pascal] how to make a type private to the unit but not defining it in the implementation section?

2019-03-08 Thread Tony Whyman
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

Re: [fpc-pascal] how to make a type private to the unit but not defining it in the implementation section?

2019-03-07 Thread Dennis Poon
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

Re: [fpc-pascal] how to make a type private to the unit but not defining it in the implementation section?

2019-03-07 Thread Anthony Walter
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 -

Re: [fpc-pascal] how to make a type private to the unit but not defining it in the implementation section?

2019-03-07 Thread Michael Van Canneyt
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;  

Re: [fpc-pascal] how to make a type private to the unit but not defining it in the implementation section?

2019-03-07 Thread Darius Blaszyk
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 > >

[fpc-pascal] how to make a type private to the unit but not defining it in the implementation section?

2019-03-07 Thread Dennis
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 }