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.75.137 with SMTP id y9mr3574502qaj.3.1366855406072; Wed, 24 Apr 2013 19:03:26 -0700 (PDT) X-Received: by 10.50.12.4 with SMTP id u4mr677073igb.5.1366855405998; Wed, 24 Apr 2013 19:03:25 -0700 (PDT) Path: ef9ni16888qab.0!nntp.google.com!gp5no5919208qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 24 Apr 2013 19:03:25 -0700 (PDT) In-Reply-To: <931385b2-3520-4d7a-b56f-6d0d0b06d467@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.20.190.126; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 69.20.190.126 References: <931385b2-3520-4d7a-b56f-6d0d0b06d467@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: AVR Usart send number string with no 'Image From: Shark8 Injection-Date: Thu, 25 Apr 2013 02:03:26 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-04-24T19:03:25-07:00 List-Id: 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;