comp.lang.ada
 help / color / mirror / Atom feed
From: vashwath@rediffmail.com (prashna)
Subject: Re: Disriminant question - Waiting desperately for solution :-(
Date: 12 Mar 2003 01:25:44 -0800
Date: 2003-03-12T09:25:44+00:00	[thread overview]
Message-ID: <d40d7104.0303120125.2ef8eb4c@posting.google.com> (raw)
In-Reply-To: 1ec946d1.0303070846.252c6407@posting.google.com

> 
> 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



  reply	other threads:[~2003-03-12  9:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-07  7:09 Disriminant question prashna
2003-03-07  8:01 ` tmoran
2003-03-07 11:20   ` Lutz Donnerhacke
2003-03-07 17:59     ` tmoran
2003-03-07 22:32       ` Lutz Donnerhacke
2003-03-07 11:17 ` Lutz Donnerhacke
2003-03-07 16:46   ` Matthew Heaney
2003-03-12  9:25     ` prashna [this message]
2003-03-12 16:12       ` Disriminant question - Waiting desperately for solution :-( Gautier
  -- strict thread matches above, loose matches on Subject: below --
2003-03-13  5:40 Grein, Christoph
2003-03-13 13:13 ` Gautier
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox