From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, UPPERCASE_50_75 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f298e2224380e530 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-12 01:25:44 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: vashwath@rediffmail.com (prashna) Newsgroups: comp.lang.ada Subject: Re: Disriminant question - Waiting desperately for solution :-( Date: 12 Mar 2003 01:25:44 -0800 Organization: http://groups.google.com/ Message-ID: References: <1ec946d1.0303070846.252c6407@posting.google.com> NNTP-Posting-Host: 203.90.112.53 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1047461144 23067 127.0.0.1 (12 Mar 2003 09:25:44 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 12 Mar 2003 09:25:44 GMT Xref: archiver1.google.com comp.lang.ada:35245 Date: 2003-03-12T09:25:44+00:00 List-Id: > > The rule is that you can't change the discriminant if the object was > declared with an explicit discriminant value. > Thanks all for helping. Here is my original code(which I should I have posted earlier but could not because this is highly confidential and hence I am showing only part of the code.Hope u ppl understand.) and a runtime error (discriminant error) is raising. procedure CLEAR_DISCON (PRIMARY_FPLN_PARAM : in out SERVER_TYPES.T_PRIMARY_FPLN; DISCON : in SERVER_TYPES.T_LEG_INDEX; REQUEST_STATUS : out SERVER_TYPES.T_REQUEST_STATUS; MODIFICATION_REPORT : out SERVER_TYPES.T_FPLN_MODIF_ORIGIN) is L_TERM : SERVER_TYPES.T_TERM; ... ... begin .... .... L_TERM := (LEG_TYPE => SERVER_TYPES.TF, FIX => PRIMARY_FPLN_PARAM.LEGS.LEGS_ARRAY(0).TERM.FIX); ^^^ exception discriminat error is raised here --PRIMARY_FPLN_PARAM.LEGS.LEGS_ARRAY(DISCON+1).TERM := L_TERM; PRIMARY_FPLN_PARAM.LEGS.LEGS_ARRAY(DISCON+1).TERM := (LEG_TYPE => SERVER_TYPES.TF, FIX => ( IDENT => L_TERM.FIX.IDENT, B_OVERFLY => L_TERM.FIX.B_OVERFLY, POS => ( LAT => L_TERM.FIX.POS.LAT, LON => L_TERM.FIX.POS.LON))); ^^^ Is this OK if I correct the previous error? .... .... end CLEAR_DISCON; package SERVER_TYPES is ...... ...... type T_FIX is record IDENT : FMS_TYPES.T_IDENT (1 .. 7); B_OVERFLY : BOOLEAN; POS : FMS_TYPES.T_POSITION; end record; type T_TERM (LEG_TYPE : T_LEG_TYPE := NONE) is record case LEG_TYPE is when DF | TF | LIF | TP => FIX : T_FIX; when PPOS | NONE => null; end case; end record; type T_LEG (LEG_TYPE : T_LEG_TYPE := NONE) is record MARK : T_LEG_INDEX := 0; TERM : T_TERM (LEG_TYPE); TURN_DIR : FMS_TYPES.T_TURN_DIR := FMS_TYPES.NONE; B_DISC_AHEAD : BOOLEAN := FALSE; STATIC_PARAMETERS : T_LEG_STATIC_PARAMETERS_C; DISTANCE_CUMUL : FMS_TYPES.T_DISTANCE_NM_C; end record; ..... ..... end SERVER_TYPES; package FMS_TYPES is ..... ..... subtype T_ANG_REL_DEG is T_DEGREE range -179.99999 .. +180.0; subtype T_LATITUDE is T_ANG_REL_DEG range -90.0 .. +90.0; subtype T_LONGITUDE is T_ANG_REL_DEG; type T_IDENT_INDEX is range 0 .. 30; type T_CHAR is ( PROG, .... .... LOZENGE); type T_IDENT is array (T_IDENT_INDEX range <>) of T_ISO5_CHAR; type T_POSITION is record LAT : T_LATITUDE; LON : T_LONGITUDE; end record; ... ... end FMS_TYPES; I am using gnat compiler on AIX machine. Hope this information is enough. Thanks