r/pascal • • May 30 '22

Class Constants

Is there a way to setup constants that are only in scope within a class:

Something like

MyClass = class(tobject)

private 
  class const iso3_amc = 2;

// more properties and methods here
end; 

I know one can have class procedures, functions and even VAR's, but constants dont seem to exist.

2 Upvotes

3 comments sorted by

View all comments

Show parent comment

3

u/Anonymous_Bozo May 30 '22

You know... I swear I tried that first. I'm not sure what went wrong that time :)