Ludo Brands wrote:
On 28/12/2012 12:59, Ludo Brands wrote:
On 28/12/2012 12:48, Mark Morgan Lloyd wrote:
Ludo Brands wrote:
type
TAllServerCapabilitiesBase=(uscConnected,
uscCanIssueGUID,lscConnected, lscCanIssueGUID, lscIsFirebird);
TUpstreamServerCapabilitiesBase= uscConnected .. usc
If you do not allow clients of your unit to define new elements or
change the set values, and what you want to do is prevent, say,
accidentally adding an extended element to the set in the base class,
you can declare extended elements as class-local constants. Otherwise
you will need to add checks
On 28/12/2012 12:59, Ludo Brands wrote:
On 28/12/2012 12:48, Mark Morgan Lloyd wrote:
Ludo Brands wrote:
type
TAllServerCapabilitiesBase=(uscConnected,
uscCanIssueGUID,lscConnected, lscCanIssueGUID, lscIsFirebird);
TUpstreamServerCapabilitiesBase= uscConnected .. uscCanIssueGUID;
TLo
On 28/12/2012 12:48, Mark Morgan Lloyd wrote:
Ludo Brands wrote:
type
TAllServerCapabilitiesBase=(uscConnected,
uscCanIssueGUID,lscConnected, lscCanIssueGUID, lscIsFirebird);
TUpstreamServerCapabilitiesBase= uscConnected .. uscCanIssueGUID;
TLocalServerCapabilitiesBase= lscConnected..
Ludo Brands wrote:
On 28/12/2012 11:42, Mark Morgan Lloyd wrote:
Is it possible to extend an enumeration, while preserving strong type
checking? In other words, given existing code like
typeTUpstreamServerCapabilitiesBase= (uscConnected, uscCanIssueGUID);
TLocalServerCapabilitiesBa
JC Chu wrote:
It is not possible to extend an enumeration type. If you are not
willing to use separate sets to hold common and extended elements, you
can use a generic (not parametric) set type, say SET OF 0..31, that
can hold all possible elements, and define the possible elements as
constants.
On 28/12/2012 11:42, Mark Morgan Lloyd wrote:
Is it possible to extend an enumeration, while preserving strong type
checking? In other words, given existing code like
typeTUpstreamServerCapabilitiesBase= (uscConnected, uscCanIssueGUID);
TLocalServerCapabilitiesBase= (lscConnected, l
It is not possible to extend an enumeration type. If you are not
willing to use separate sets to hold common and extended elements, you
can use a generic (not parametric) set type, say SET OF 0..31, that
can hold all possible elements, and define the possible elements as
constants.
On Fri, Dec 28
Is it possible to extend an enumeration, while preserving strong type
checking? In other words, given existing code like
typeTUpstreamServerCapabilitiesBase= (uscConnected, uscCanIssueGUID);
TLocalServerCapabilitiesBase= (lscConnected, lscCanIssueGUID,
lscIsFirebird);
TUps
Thierry Coq wrote:
On 18/07/2010 20:56, Mark Morgan Lloyd wrote:
...
Yes, I was thinking that. However if the basic class was say a
round-robin scheduler with phases rrQuiescent and rrInitialised and
the descendant was say an HP comms protocol handler with additional
phases hpReceivingPadding,
On 18/07/2010 20:56, Mark Morgan Lloyd wrote:
...
Yes, I was thinking that. However if the basic class was say a
round-robin scheduler with phases rrQuiescent and rrInitialised and
the descendant was say an HP comms protocol handler with additional
phases hpReceivingPadding, hpReceivedSync and
> Yes, I was thinking that. However if the basic class was say a
> round-robin scheduler with phases rrQuiescent and rrInitialised and the
> descendant was say an HP comms protocol handler with additional phases
> hpReceivingPadding, hpReceivedSync and so on it would seem to be
> questionable pract
Jetcheng Chu wrote:
As far as I know, properties cannot be overridden. However, you could
consider using subrange types, as the example below shows.
type
Fruit = (Apple, Banana, Cherry, Orange, Pineapple);
LimitedFruit = Apple..Cherry;
You can use the full enumeration as the property's typ
trict its value using a custom property setter.
-- Original Message --
Subject: [fpc-pascal] Extending an enumeration
Date: Sun, 18 Jul 2010 16:23:13 +
To: fpc-pascal@lists.freepascal.org
From: Mark Morgan Lloyd
> If I have a class with a property Phase: TrrPhase where TrrPha
If I have a class with a property Phase: TrrPhase where TrrPhase is an
enumeration such as (rrQuiescent, rrInitialised), is there an elegant
way of extending the enumeration and overriding the property type so
that a derived class can use the new values?
--
Mark Morgan Lloyd
markMLl .AT. tel
15 matches
Mail list logo