[fpc-pascal]A couple of easy questions on clsses
Michael.VanCanneyt at Wisa.be
Michael.VanCanneyt at Wisa.be
Thu Aug 14 21:24:53 CEST 2003
On Thu, 14 Aug 2003, Aitor [ISO-8859-1] Santamaría Merino wrote:
> 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)?
Not yet in 1.0.10 . I believe it is implemented in 1.1
> 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.
This is correct.
>
> (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).
Yes. I will check the wording.
Michael.
More information about the fpc-pascal
mailing list