Sign in Join
Wiki copytemporary

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.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.