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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,87b54dbabc658fa2 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.18.133 with SMTP id w5mr15268945qaa.1.1366943329345; Thu, 25 Apr 2013 19:28:49 -0700 (PDT) X-Received: by 10.49.42.1 with SMTP id j1mr88629qel.41.1366943329296; Thu, 25 Apr 2013 19:28:49 -0700 (PDT) Path: ef9ni16888qab.0!nntp.google.com!gp5no7037430qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 25 Apr 2013 19:28:49 -0700 (PDT) In-Reply-To: <508e7264-46c3-4c53-94e6-6bb427fb3908@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=189.110.14.106; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu NNTP-Posting-Host: 189.110.14.106 References: <931385b2-3520-4d7a-b56f-6d0d0b06d467@googlegroups.com> <508e7264-46c3-4c53-94e6-6bb427fb3908@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <7bb4c21a-be68-433e-a517-484798a8a687@googlegroups.com> Subject: Re: AVR Usart send number string with no 'Image From: "Rego, P." Injection-Date: Fri, 26 Apr 2013 02:28:49 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-04-25T19:28:49-07:00 List-Id: I tried this, but the compiler pointed that I could not use the second stack, so this recursion is not allowed. On Thursday, April 25, 2013 7:55:38 AM UTC-3, Rego, P. wrote: > On Wednesday, April 24, 2013 11:03:25 PM UTC-3, Shark8 wrote: > > > declare > > > Subtype Digit is Character Range '0'..'9'; > > > Function To_String( Input : Interfaces.Unsigned_8 ) Return String is > > > Subtype Digital is Interfaces.Unsigned_8 Range 0..9; > > > begin > > > if Input in Digital then > > > Return (1 => Digit'Val( Natural(Input) + Character'Pos('0') )); > > > else > > > declare > > > Use Type Interfaces.Unsigned_8; > > > D2 : Constant Interfaces.Unsigned_8:= Input / 10; > > > D1 : Constant Interfaces.Unsigned_8:= Input mod 10; > > > begin > > > Return To_String(D2) & To_String(D1); > > > end; > > > end if; > > > end To_String; > > > Subtype Byte_Range is Integer range 0..255; > > > X : Integer := 4; > > > begin > > > While X in byte_range loop > > > Ada.Text_IO.Put_Line( To_String( Interfaces.Unsigned_8(X) ) ); > > > X:= X*2; > > > end loop; > > > end; > > > > Thanks Shark8, much interesting your solution.