Class constants
FP supports typed class constants, if the compiler-switch
{$static on}is set. There are no untyped class constants.
type
TCars = class(TVehicles)
private
public
wheelcount: integer; static;
end;
begin
TCars.wheelcount := 4;
// further assignments are forbidden
end.Weblinks
- “Static fields” in FPC-doc
From the Free Pascal wiki, page "Class constants", as it stood on 2018-02-13 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.