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=0.6 required=5.0 tests=BAYES_00,FROM_WORDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b50bc6538a649497 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-11-08 19:50:32 PST Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!nntp.flash.net!news.flash.net!not-for-mail From: "Ken Garlington" Newsgroups: comp.lang.ada References: <8tvbcq$8201@news.cis.okstate.edu> <8u505a$9ic1@news.cis.okstate.edu> <3A09A13F.CE7DF6EF@cepsz.unizar.es> Subject: Re: if statements X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: Date: Thu, 09 Nov 2000 03:50:30 GMT NNTP-Posting-Host: 216.215.86.151 X-Complaints-To: abuse@flash.net X-Trace: news.flash.net 973741830 216.215.86.151 (Wed, 08 Nov 2000 21:50:30 CST) NNTP-Posting-Date: Wed, 08 Nov 2000 21:50:30 CST Organization: FlashNet Communications, http://www.flash.net Xref: supernews.google.com comp.lang.ada:1917 Date: 2000-11-09T03:50:30+00:00 List-Id: "Alejandro Villanueva" <190921@cepsz.unizar.es> wrote in message news:3A09A13F.CE7DF6EF@cepsz.unizar.es... : Alejandro R. Mosteo wrote: : : > Hello. Here in Spain, my university (in Zaragoza) uses Ada as the : > programming languaje in several subjects (all of them half academic : > year duration): : > : : Well, if you see my address you will see that I'm from the same Uni that you... : : My final project is also with Ada95 running under RTEMS (the degree is : industrial engineering, 5-year long) : : And now... : : procedure Swap (A, B: in out Integer) is : C: Integer; : begin : if A > B then : C := B; : B := A; : A := C; : end if; : end Swap; Of course, this would violate the implied requirement that no code surround the "if" statement. How about (assuming A and B are Integer): if A > B then declare Original_B : constant Integer := B; begin B := A; A := Original_B; end; end if;