Pascal (programming language): Difference between revisions

Content deleted Content added
Union types: Pascal uses the term record, not union. If the author is referring to the C type union, that is properly termed a variant record in Pascal.
Record types: Trying to clean up a mess. This is a *Pascal* article, not about Unions. All that was required here is an example of Pascal record types.
Line 234:
 
===Record types===
 
{{excerpt|Union type|Pascal}}
An example of a Pascal record type:
 
type
Shape = (Circle, Square, Triangle);
Dimensions = record
case Figure: Shape of
Circle: (Diameter: real);
Square: (Width: real);
Triangle: (Side: real; Angle1, Angle2: 0..360)
end;
 
===Type declarations===