Class constants

From Free Pascal wiki
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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