From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Printing the address Date: Tue, 11 May 2021 15:41:16 +0300 Organization: Tidorum Ltd Message-ID: References: <609a5eaf$0$20558$e4fe514c@news.kpn.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net 3SaZopu9Va0wD5DsNqmqpwi2+/nz3V6hNP8IsfHI81k8rxoBEP Cancel-Lock: sha1:S0nmReX/FI8z/YLX85x20zeaZZk= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 In-Reply-To: <609a5eaf$0$20558$e4fe514c@news.kpn.nl> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61980 List-Id: On 2021-05-11 13:38, ldries46 wrote: > I Get an contstraint error in the line: > /if Boxes(n).Status = manual or Boxes(n).Status = auto then/ That is either becase "n" is not in Boxes'Range, or because Boxes(n) is null. From the rest of your message, it seems you believe that the latter is the cause. (Btw, a briefer expression is if Boxes(n).Status in manual | auto then ... assuming that Box_Status is a discrete type.) > where/: >    Boxes     : Ar_Box; >    type Box is record >       Status  : Box_Status; >       Nrs_pos : Ar_Pos; >       x_val   : integer; >       y_val   : integer; >       Fill    : integer; >    end record; > ///   type Box_Acces is access all Box; > /   type Ar_Box is array (1 .. Max_Num) of Box_Acces; > > /To debug the program I need to finf where the constraint is > possible a 0x0 somewhere in Box I assume you mean that some element of Boxes is a null access. That may or may not be represented as 16#0#. > How can I priint this value I tried converting it to and integer but I > couldn'd get that working You don't have to print the value. All that should matter to you is whether the value is null or not, so: Put (if Boxes(n) = null then "null" else "not null"); (If you really want to print the address, do System.Storage_Elements.Integer_Address'Image ( System.Storage_Elements.To_Integer (Boxes(n).all'Address)) but be sure to check for a null value of Boxes(n) first.)