[fpc-pascal]A couple of easy questions on clsses
Aitor SantamarĂa Merino
aitor.sm at wanadoo.es
Thu Aug 14 13:19:48 CEST 2003
Hi,
After reading the reference documentation on classes, I have a couple of
easy aspects of the documentation that were unclear to me.
(1) Is there the concept of "static field" or "class field" (meaning a
field that is not instanciated, but remains the same var for all the
instances)? I know this can be easily made with an external variable,
but I consider it to be a different concept.
The syntax diagrams of classes show that a method can be preceded by the
keyword "class" (and I failed to find where it is explained what for?),
but does not seem to admit this keyword before a field.
(2) In the documentation, it is said "The Inherited keyword will not
jump to the inherited method, if virtual was used." and also "The
compiler will compile it, but using Inherited can produce strange
effects." (where neither of the examples shows the word "Inherited"),
but I fail to understand if these sentences refer to the case in which
you do it wrong, and declare both MyProc as virtual (instead as
"virtual" and "override", respectively).
So should I understand that I can use Inherited without problems if I do
it right? (means virtual/override).
Aitor
More information about the fpc-pascal
mailing list