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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,95db39b88fd27b40,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-23 07:49:25 PST From: "Stephen Frackelton" Newsgroups: comp.lang.ada Subject: Convert array to integer value Date: Thu, 23 May 2002 15:49:24 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 NNTP-Posting-Host: waec3223.wa.bae.co.uk Message-ID: <3ced014d$1@pull.gecm.com> X-Trace: pull.gecm.com 1022165325 waec3223.wa.bae.co.uk (23 May 2002 15:48:45 +0100) Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!btnet-peer!btnet-peer0!btnet-feed3!btnet!newreader.ukcore.bt.net!pull.gecm.com!not-for-mail Xref: archiver1.google.com comp.lang.ada:24578 Date: 2002-05-23T15:49:24+01:00 List-Id: I have set up an array of integers, value 0..1, to simulate a word, 16 bits. I need to convert this array of 0's and 1's from the binary value to its corresponding integer value. is there any simple way of doing this ? All i can think of is for loop through the array and having a translation table for each position within the array, i.e if bit 5 = 1 then add 16 to total, if bit 6 = 1 then add 32 to total and so on. any other ideas ? thanks Stephen