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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.58.136.100 with SMTP id pz4mr3776870veb.26.1391703209226; Thu, 06 Feb 2014 08:13:29 -0800 (PST) X-Received: by 10.182.3.12 with SMTP id 12mr10133oby.36.1391703208924; Thu, 06 Feb 2014 08:13:28 -0800 (PST) Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!f11no13122337qae.1!news-out.google.com!gj3ni3igc.0!nntp.google.com!uq10no10131454igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 6 Feb 2014 08:13:28 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=192.109.190.88; posting-account=XDglRgoAAAAB2wikSHYkYcjK-5hIYGIR NNTP-Posting-Host: 192.109.190.88 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Need help for constrained type From: Gerd Injection-Date: Thu, 06 Feb 2014 16:13:28 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 1866 Xref: number.nntp.dca.giganews.com comp.lang.ada:184681 Date: 2014-02-06T08:13:28-08:00 List-Id: Hello, can someone help me? This is my problem: I have a record containing a constrainted array. I can write it like this: type Mem_Array is array (Natural range <>) of Short_Integer; type Memory_Block (len : Natural) is record Start_Address : Mem_Addr; Block_Size : Natural; Usage_Info : Mem_Array (1..len); end record; mem : Memory_Block (2**16); -- for example But i would like the indices of Usage_Info running from 0..len - 1 (C-style). But when I write type Memory_Block (len : Natural) is record Start_Address : Mem_Addr; Block_Size : Natural; Usage_Info : Mem_Array (0..len-1); end record; the compiler tells me that this is not allowed. Is it possible to allocate "len" units, but address them from 0 .. len - 1? How can I do this? Thanks.