[fpc-pascal] What's a unit?
pascaldragon at googlemail.com
Tue Feb 19 18:16:06 CET 2013
On 19.02.2013 18:08, Mark Morgan Lloyd wrote:
> Sven Barth wrote:
>>> Thanks Sven, looks interesting and I'll play with it presently. Can an
>>> extended record's fields/methods be set up at compilation time, or do
>>> they need to be done by code?
>> The example I've given was for the case that you load the functions
>> dynamically and use the procvars contained in the record. You could do
>> it this way as well:
> Yes, that's pretty much what I'm already doing (courtesy of somebody's
> Delphi NAG bindings). But what about the static case, i.e. can an
> extended record be exposed as a constant in an ordinary unit (no DLLs
> etc. involved) with the methods preinitialised?
Yes, that will work. You can even initialize private fields (though I
don't know whether it needs to be in the same unit in that case...).
More information about the fpc-pascal