Difference between revisions of "Class constants"
From Free Pascal wiki
Jump to navigationJump to searchm (correct syntax error) |
m (add Category:Code) |
||
Line 21: | Line 21: | ||
[[Category:FPC]] | [[Category:FPC]] | ||
[[Category:Constants]] | [[Category:Constants]] | ||
+ | [[Category:Code]] |
Latest revision as of 03:03, 13 February 2018
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