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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,13bebe8869a9207e,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-07 08:30:42 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: chrissy_brady1@yahoo.com (chrissy) Newsgroups: comp.lang.ada Subject: Octal Conversion in VB Date: 7 Sep 2003 08:30:39 -0700 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 211.29.166.185 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1062948641 13413 127.0.0.1 (7 Sep 2003 15:30:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 7 Sep 2003 15:30:41 GMT Xref: archiver1.google.com comp.lang.ada:42235 Date: 2003-09-07T15:30:41+00:00 List-Id: I was playing around in VB trying to come up with a simple application to convert entered strings of alphanumerics into octal numbers. I took the approach of declaring a series of variables as integers, and calling the library functions "Val" and "Str" to handle the data conversions from the text box I was using to key in the alphanumerics and to the text box I was assigning the resulting string. I then wrote a series of expressions to assign values to each of the declared variables, in sequence. I then concatenated the resultant character string to produce the number sequence. Thus: Private Sub cmdConvert_Click() Dim A, B, C, D as Integer A = Val(txtDecimal.Text) B = A Mod 8 C = A \ 8 Mod 8 D = A \ (8 ^ 2) txtOctal.Text = Str(D) + Str (C) + Str (B) End Sub This seemed to work, but the code looked ugly, and I'm not sure a truth table would support the conversion to infinity. Am I right? Is there a better and tidier way? Hoping for some guidance Chrissy