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 y9mr6936062qaj.3.1367440503120; Wed, 01 May 2013 13:35:03 -0700 (PDT) X-Received: by 10.49.42.1 with SMTP id j1mr357569qel.41.1367440503055; Wed, 01 May 2013 13:35:03 -0700 (PDT) Path: ef9ni40844qab.0!nntp.google.com!s14no1757990qam.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 1 May 2013 13:35:02 -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=189.110.14.106; posting-account=TRgI1QoAAABSsYi-ox3Pi6N-JEKKU0cu NNTP-Posting-Host: 189.110.14.106 References: <931385b2-3520-4d7a-b56f-6d0d0b06d467@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <443a92d3-2327-423d-ad74-174b0a69e4c4@googlegroups.com> Subject: Re: AVR Usart send number string with no 'Image From: "Rego, P." Injection-Date: Wed, 01 May 2013 20:35:03 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-05-01T13:35:02-07:00 List-Id: Now I am trying to implement the inverse (String to Unsigned_8), but something is missing... I tried function String_To_Unsigned_8 (Input : String) return Unsigned_8 is Result : Unsigned_8 := 0; begin for Digit in Input'Range loop Result := 10*Result + (Character'Pos (Input (Digit)) - Character'Pos ('0')); end loop; return Result; end String_To_Unsigned_8; But the result is not right. Maybe did I forget something?