Bo Berglund via lazarus <lazarus@lists.lazarus-ide.org> schrieb am Do., 24. Sep. 2020, 15:22:
> On Thu, 24 Sep 2020 14:22:13 +0200, Sven Barth via lazarus > <lazarus@lists.lazarus-ide.org> wrote: > > >Well, Bo could always split the data type declarations into a separate > >unit. > > But I cannot wrap my head around this (constructed example): > > interface > > type > TMyRecord = packed record > Item1: word; > Item2: Cardinal; > end; > > > TMyController = class > private > FGPIO_driver: TIoDriver; > FGpF: TIoPort; > function CheckValidRelay(Relay: byte): boolean; > public > constructor Create; > destructor Destroy; override; > procedure ClearRelays; > function PulseRelay(Relay: byte; PulseTime: LongWord): boolean; > function RelayOff(Relay: byte): boolean; > function RelayOn(Relay: byte): boolean; > function RelayState(Relay: byte): boolean; > procedure Delay(T: LongWord); > end; > > implementation > ...All of the methods here... > > AFAIK the records could be declared elsewhere but the objects not > since their methods, constructor, destructor etc reside in the same > file below implementation, right? > Would your code require the hypothetical TMyController or only the TMyRecord? If it only requires the later then you could indeed solve this by moving the record into a separate unit. If your code requires TMyController as well, then it can't be left out anyway (though the compiler will leave out any non-virtual method of that class which isn't used). > Just specifying a uses file with everything above the implementation > will not cut it, right? > No, that will not help. Regards, Sven
-- _______________________________________________ lazarus mailing list lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus