Variant records..
From: Ganesh Ramasivan (ganesh.ramasivan_at_gdcanada.com)
Date: 02/15/04
- Previous message: David Starner: "Re: UTF-8 (was: AI-285 - Comment from Unicode list)"
- Next in thread: Preben Randhol: "Re: Variant records.."
- Reply: Preben Randhol: "Re: Variant records.."
- Reply: tmoran_at_acm.org: "Re: Variant records.."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 15 Feb 2004 14:51:30 -0800
In the following example, how would i forbid the user of data type Foo
from specifying the following:
John : Foo(Vehicle => MAN, Power => AUTOMATIC);
ie. is there a way to restrict the user from specifying certain types
as variants?
Thanks for your input.
Ganesh
Example:
procedure Variant is
type Vehicle_Type is (CAR, LEGS, BIKE, PLANE);
type Vehicle_Power is (MANUAL, AUTOMATIC);
type Foo(Vehicle : Vehicle_Type; Power: Vehicle_Power) is
record
case Vehicle is
when CAR =>
null;
when LEGS =>
null;
when BIKE =>
null;
when PLANE =>
null;
when others =>
null;
end case;
end record;
Audi : Foo(Vehicle => CAR, Power => MANUAL);
begin
null;
end Variant;
- Previous message: David Starner: "Re: UTF-8 (was: AI-285 - Comment from Unicode list)"
- Next in thread: Preben Randhol: "Re: Variant records.."
- Reply: Preben Randhol: "Re: Variant records.."
- Reply: tmoran_at_acm.org: "Re: Variant records.."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|