comp.lang.ada
 help / color / mirror / Atom feed
* Help  - compiler errors
@ 2001-08-28 11:38 Luke
  2001-08-28 12:01 ` Marc A. Criley
  0 siblings, 1 reply; 2+ messages in thread
From: Luke @ 2001-08-28 11:38 UTC (permalink / raw)


I am a first year computer science student having problems compiling
an important piece of work (GNAT 3.13p). I've got to hand it in soon,
and can't get past the problems I've got. Please could anyone try and
help.

The problem is with line 154


   129. Get(CurrentRiderNumber);
   130. CurrentRiderTeam := RiderToTeam(2,CurrentRiderNumber);
   131. 
   132. -- get/process/store riders finishtime  
   133. 
   134.  Get(Hours);
   135.  Get(Minutes);
   136.  Get(Seconds);
   137.  RidersFinish := Hours * 3600 + Minutes * 60 + Seconds;
   138. 
   139. 
   140. -- Add team time to team array
   141. 
   142.  TeamArray(CurrentRiderTeam).NumFinish :=         
TeamArray(CurrentRiderTeam).NumFinish + 1;
   143.  
   144.  IF TeamArray(CurrentRiderTeam).NumFinish = 5 THEN
   145.     TeamArray(CurrentRiderTeam).TeamTime := RidersFinish -    
                                           
TeamArray(CurrentRiderTeam).TeamStartTime;
   146.  END IF;
   147. 
   148. END LOOP;
   149. 
   150. -- Add finish time to rider array
   151. 
   152.  OverallTime := RidersFinish -         
TeamArray(CurrentRiderTeam).TeamStartTime;
   153. 
   154.  RiderArray(CurrentRiderTeam(TeamArray(CurrentRiderTeam).NumFinish),2)
         := OverallTime; 
                                                                      
        >>> array type required in indexed component
        >>> too many subscripts in array reference
        >>> expected type "RiderTimesType" defined at line 29
        >>> found type "Standard.Integer"

   155. 
   156.  



Below are the array declarations and things.


    19. TYPE Name IS ARRAY (1..30) OF Character;
    20. 
    21. TYPE TeamStartInfo IS RECORD
    22.      TeamName      : Name;
    23.      TeamStartTime : Integer;
    24.      TeamTime      : Integer;
    25.      NumFinish     : Integer;
    26.                    END RECORD;
    27. 
    28. TYPE TeamDataType   IS ARRAY (1..25)       OF TeamStartInfo;
    29. TYPE RiderTimesType IS ARRAY (1..8 , 1..2) OF Integer;
    30. TYPE RiderDataType  IS ARRAY (1..25)       OF RiderTimesType;
    31. 
    32. 
    33. TYPE TeamFinInfo IS RECORD
    34.      TeamName  : Name;
    35.      TeamTime  : Integer;
    36.      Riders    : RiderTimesType;
    37.      NumFinish : Integer;
    38.                      END RECORD;
    39.                      
    40. TYPE FinDataType     IS ARRAY (1..25)         OF TeamFinInfo;
    41. TYPE RiderNonFinType IS ARRAY (1..200)        OF Integer;
    42. TYPE RiderListType   IS ARRAY (1..2 , 1..200) OF Integer;
    43. 
    44. TeamArrayMain            : TeamDataType;    
    45. RiderArrayMain           : RiderDataType;
    46. TeamsThatFinishMain      : FinDataType;
    47. TeamsThatDontFinishMain  : FinDataType;
    48. RidersThatDontFinishMain : RiderNonFinType := (1..200 => 999);
    49. RiderToTeamMain          : RiderListType; 
    50. 


I would be very grateful if anyone could help and I expect I'll be
back to this group with my next round of errors I can't solve once
I've hopefully sorted this one.

Thanks very much

Luke Pattison - 1st yr. IT & Business, Aston Uni, UK



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Help  - compiler errors
  2001-08-28 11:38 Help - compiler errors Luke
@ 2001-08-28 12:01 ` Marc A. Criley
  0 siblings, 0 replies; 2+ messages in thread
From: Marc A. Criley @ 2001-08-28 12:01 UTC (permalink / raw)


Luke wrote:
> 

I think you need some sleep :-)

>    154.  RiderArray(CurrentRiderTeam(TeamArray(CurrentRiderTeam).NumFinish),2)
>          := OverallTime;

Shouldn't "RiderArray" be "RiderArrayMain"?  And "TeamArray" be
"TeamArrayMain"?  And in the list of declarations you didn't include
"CurrentRiderTeam".  And even so, it's referenced twice--once as an
array, and once as an array index.

Marc A. Criley
Senior Staff Engineer
Quadrus Corporation
www.quadruscorp.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-28 12:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-28 11:38 Help - compiler errors Luke
2001-08-28 12:01 ` Marc A. Criley

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