comp.lang.ada
 help / color / mirror / Atom feed
* Linking Error
@ 1996-11-27  0:00 Michael C.
  0 siblings, 0 replies; only message in thread
From: Michael C. @ 1996-11-27  0:00 UTC (permalink / raw)



Hello,

When I try to link the following code, it (my GNAT305 compiler) gives the
following message:

	d:/programi/gnat305/bin\ld.exe: cannot open output file tritest: Permission 
	denied (EACCES)

I would appreciate any information that could aid me in finishing this project.
Thank you,

Michael C.
rculbert@ix.netcom.com

*** File "TRITEST.ADB" ***

with Text_IO; use Text_IO;
procedure Tritest is
   Passed : Boolean := True;
   type Triangle is (Equilateral, Isosceles, Scalene, Not_a_Triangle);
   function Tritype(Len1, Len2, Len3 : in Integer) return Triangle
                                                          is separate;
   procedure Compare(A, B, C: in Integer; Right_Answer : in Triangle)
                                                          is separate;
begin
   Compare( 3,  4,  5, Scalene);
   Compare( 6,  3,  4, Scalene);
   Compare( 4,  3,  6, Scalene);
   Compare( 3,  3,  3, Equilateral);
   Compare( 3,  3,  4, Isosceles);
   Compare( 3,  4,  3, Isosceles);
   Compare( 4,  3,  3, Isosceles);
   Compare( 7,  7,  4, Isosceles);
   Compare( 7,  4,  7, Isosceles);
   Compare( 4,  7,  7, Isosceles);
   Compare( 1,  1,  1, Equilateral);
   Compare( 0,  4,  4, Not_a_Triangle);
   Compare( 4,  0,  4, Not_a_Triangle);
   Compare( 4,  4,  0, Not_a_Triangle);
   Compare( 0,  4,  3, Not_a_Triangle);
   Compare( 3,  0,  4, Not_a_Triangle);
   Compare( 4,  3,  0, Not_a_Triangle);
   Compare(-1,  4,  4, Not_a_Triangle);
   Compare( 4, -1,  4, Not_a_Triangle);
   Compare( 4,  4, -1, Not_a_Triangle);
   Compare(-1,  4,  3, Not_a_Triangle);
   Compare( 3, -1,  4, Not_a_Triangle);
   Compare( 4,  3, -1, Not_a_Triangle);
   Compare( 2,  4,  6, Not_a_Triangle);
   Compare( 1,  3,  2, Not_a_Triangle);
   Compare( 3,  1,  2, Not_a_Triangle);
   Compare( 1,  2,  4, Not_a_Triangle);
   Compare( 1,  4,  2, Not_a_Triangle);
   Compare( 4,  1,  2, Not_a_Triangle);
   Compare( 0,  0,  0, Not_a_Triangle);
   Compare( 0,  0,  4, Not_a_Triangle);
   Compare( 0,  4,  0, Not_a_Triangle);
   Compare( 4,  0,  0, Not_a_Triangle);
   Compare( 3,  3,  7, Not_a_Triangle);
   Compare( 3,  7,  3, Not_a_Triangle);
   Compare( 6,  3,  3, Not_a_Triangle);
   Compare(-3, -4, -5, Not_a_Triangle);
   if Passed then
      Put_Line("Congratulations, you completed the assignment!");
   end if;
end Tritest;

*** File "TRITCOMP.ADB" ***


separate (Tritest)
procedure Compare(A, B, C: in Integer; Right_Answer : in Triangle) is
   package Int_IO is new Integer_IO(Integer); use Int_IO;
   package Tri_IO is new Enumeration_IO(Triangle); use Tri_IO;
   My_Answer : Triangle := Tritype(A, B, C);
begin
   if My_Answer /= Right_Answer Then
      Put("Sides:");
      Put(A, Width => 3);
      Put(B, Width => 3);
      Put(C, Width => 3);
      Put("   My answer: ");
      Put(My_Answer, Width => 14);
      Put("   Right answer: ");
      Put(Right_Answer);
      New_Line;
      Passed := False;
   end if;
end Compare;

*** File "TRITTRIT.ADB" ***

separate (Tritest)
function Tritype(Len1, Len2, Len3 : in Integer) return Triangle is
	Response : Triangle;
begin
	if Len1=Len2 and Len2=Len3 then
			Response := Equilateral;
		elsif Len1=Len2 or Len2=Len3 or Len1=Len3 then
			Response := Isosceles;
		elsif Len1+Len2>Len3 and Len2+Len3>Len1 and Len1+Len3>Len2 then
			Response := Scalene;
		else
			Response := Not_a_Triangle;
		end if;
	return Response;
end Tritype;

*** End of Files ***





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-11-27  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-27  0:00 Linking Error Michael C.

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