Class constants

From Free Pascal wiki
Revision as of 15:49, 19 July 2014 by Kai Burghardt (talk | contribs) (Created page with "FP supports typed class constants, if the compiler-switch <syntaxhighlight lang="pascal"> {$static on} </syntaxhighlight> is set. There are no untyped class constants. <synta...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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