Sign in Join
Wiki copytemporary

Revision 1 of 1, by Kai Burghardt on 2-13-2018. The page as it is now.

Class constants

FP supports typed class constants, if the compiler-switch

pascal
{$static on}

is set. There are no untyped class constants.

pascal
type
    TCars = class(TVehicles)
        private
        public
            wheelcount: integer; static;
    end;

begin
    TCars.wheelcount := 4;
    // further assignments are forbidden
end.

Weblinks


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.