On Oct 8, 2009, at 9:12 AM, Jürgen Hestermann wrote:
And I don't know any other Pascal Compiler who does any checks in
this direction. Do some?
I don't know, but ADA reportedly does.
I don't know the differences to Pascal. Does it have the same syntax
for variant records?
FWIW, here
"Jürgen Hestermann" :
> >> And I don't know any other Pascal Compiler who does any checks in
> >> this direction. Do some?
> > I don't know, but ADA reportedly does.
Yes, but the semantics of discriminants is slightly different than in PASCAL.
> I don't know the differences to Pascal. Does it ha
And I don't know any other Pascal Compiler who does any checks in this
direction. Do some?
I don't know, but ADA reportedly does.
I don't know the differences to Pascal. Does it have the same syntax for
variant records?
Such a feature definitely seems useful to me.
Of course it would b
Given that the OP was asking about learning, maybe it would be worth
mentioning that the way we normally have "data structures which hold
different data" these days is by polymorphism in objects or classes.
Instead of having an array of variant records, each of which might hold
a description of
On 07/10/2009 16:39, Jürgen Hestermann wrote:
IIRC, there is a difference. With the second declaration the compiler
can add a run-time check that the correct memebrs are accessed based
on the value of X.
Unfortunately, I cannot find the compiler switch.
FPC has no support for this.
And I d
Jonas Maebe schrieb:
>
> On 07 Oct 2009, at 17:39, Jürgen Hestermann wrote:
>
>> And I don't know any other Pascal Compiler who does any checks in this
>> direction. Do some?
>
> I don't know, but ADA reportedly does. Such a feature definitely seems
> useful to me.
Afaik GPC does as well?
_
On 07 Oct 2009, at 17:39, Jürgen Hestermann wrote:
And I don't know any other Pascal Compiler who does any checks in
this direction. Do some?
I don't know, but ADA reportedly does. Such a feature definitely seems
useful to me.
Jonas___
fpc-pas
IIRC, there is a difference. With the second declaration the compiler
can add a run-time check that the correct memebrs are accessed based
on the value of X.
Unfortunately, I cannot find the compiler switch.
FPC has no support for this.
And I don't know any other Pascal Compiler who does any
On 07 Oct 2009, at 10:18, Florian Klaempfl wrote:
Vincent Snijders schrieb:
Jonas Maebe schreef:
On 07 Oct 2009, at 09:19, Vincent Snijders wrote:
IIRC, there is a difference. With the second declaration the
compiler
can add a run-time check that the correct memebrs are accessed
based
Vincent Snijders schrieb:
> Jonas Maebe schreef:
>>
>> On 07 Oct 2009, at 09:19, Vincent Snijders wrote:
>>
>>> IIRC, there is a difference. With the second declaration the compiler
>>> can add a run-time check that the correct memebrs are accessed based
>>> on the value of X.
>>>
>>> Unfortunately
Jonas Maebe schreef:
On 07 Oct 2009, at 09:19, Vincent Snijders wrote:
IIRC, there is a difference. With the second declaration the compiler
can add a run-time check that the correct memebrs are accessed based
on the value of X.
Unfortunately, I cannot find the compiler switch.
FPC has no
On 07 Oct 2009, at 09:19, Vincent Snijders wrote:
IIRC, there is a difference. With the second declaration the
compiler can add a run-time check that the correct memebrs are
accessed based on the value of X.
Unfortunately, I cannot find the compiler switch.
FPC has no support for this.
Jürgen Hestermann schreef:
Therefore, there is absolutly no difference between
TFigure = record
X : TShapeList;
case TShapeList of
Rectangle: (Height, Width: Real);
Triangle: (Side1, Side2, Angle: Real);
Circle: (Radius: Real);
On 10/06/2009 06:31 PM, Frank Peelo wrote:
Any new concepts that were introduced, like properties, were applied
only to the new classes and objects were left in a corner, like the
embarrassing relative that you wish you could get rid of, but can't.
However, AFAIK Free Pascal supports properties
On Wed, 2009-10-07 at 07:22 +0200, Jürgen Hestermann wrote:
> Therefore, there is absolutly no difference between
>
> TFigure = record
>X : TShapeList;
>case TShapeList of
> Rectangle: (Height, Width: Real);
> Triangle: (Side1, Side2, Angle: R
AFAIK there has to be some fixed part before the variant, e. g.
TFigure = record
name: string;
case TShapeList of
Rectangle: (Height, Width: Real);
Triangle: (Side1, Side2, Angle: Real);
Circle: (Radius: Real);
Ellipse, Other: ();
end;
The program could then dete
I see. That means if no tag name is given, I should make sure my code
is correct by myself.
Thank you.
2009/10/7 Anton Tichawa :
> On Tue, 2009-10-06 at 23:37 +0800, 章宏九 wrote:
>> Thank you. I saw all the examples you gave, but I still cannot master
>> how to use a variant record without a specif
On Tue, 2009-10-06 at 23:37 +0800, 章宏九 wrote:
> Thank you. I saw all the examples you gave, but I still cannot master
> how to use a variant record without a specified tag.
>
> For example:
> type
> TShapeList = (Rectangle, Triangle, Circle, Ellipse, Other);
> TFigure = record
> case TShap
Thank you. I saw all the examples you gave, but I still cannot master
how to use a variant record without a specified tag.
If you use a specific tag as in
type TFigure = record
case ShapeName : TShapeList of
Rectangle: (Height, Width: Real);
Tr
2009/10/6 章宏九 :
> Thank you. I saw all the examples you gave, but I still cannot master
> how to use a variant record without a specified tag.
>
> For example:
> type
> TShapeList = (Rectangle, Triangle, Circle, Ellipse, Other);
> TFigure = record
> case TShapeList of
> Rectangle: (Height
Thank you. I saw all the examples you gave, but I still cannot master
how to use a variant record without a specified tag.
For example:
type
TShapeList = (Rectangle, Triangle, Circle, Ellipse, Other);
TFigure = record
case TShapeList of
Rectangle: (Height, Width: Real);
Triangl
On 06/10/2009 15:00, Felipe Monteiro de Carvalho wrote:
On Tue, Oct 6, 2009 at 10:13 AM, 章宏九 wrote:
Type
MyRec = Record
X : Longint;
Case byte of
2 : (Y : Longint;
case byte of
3 : (Z : Longint);
);
end;
I think
2009/10/6 Henry Vermaak :
>
> I can't really comment on the scary details, since I'm rubbish at
> object oriented programming :)
And objects aren't deprecated, since the compiler uses them (afaik).
Henry
___
fpc-pascal maillist - fpc-pascal@lists.free
On Tue, Oct 6, 2009 at 10:13 AM, 章宏九 wrote:
> Type
> MyRec = Record
> X : Longint;
> Case byte of
> 2 : (Y : Longint;
> case byte of
> 3 : (Z : Longint);
> );
> end;
I think the cases are useless here. AFAIK th
2009/10/6 章宏九 :
> In the document
> (http://www.freepascal.org/docs-html/ref/refsu15.html#x38-450003.3.2)
> I read the code below:
>
> Type
> MyRec = Record
> X : Longint;
> Case byte of
> 2 : (Y : Longint;
> case byte of
> 3 : (Z : Long
In the document
(http://www.freepascal.org/docs-html/ref/refsu15.html#x38-450003.3.2)
I read the code below:
Type
MyRec = Record
X : Longint;
Case byte of
2 : (Y : Longint;
case byte of
3 : (Z : Longint);
);
26 matches
Mail list logo