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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: ADA.STRINGS.INDEX_ERROR : a-strunb.adb:782 Date: Mon, 15 Jan 2018 10:37:07 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="bace45c2e433887fcd332d54126ebdc1"; logging-data="19829"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18O7KkAQr3N06TfalpFKriLigTUHrfRQOY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:whBN02RKNlQkDu3T2pYoUQLx2u0= sha1:epeOJtwoNbZIwhyFB2Ikjg7OvzI= Xref: reader02.eternal-september.org comp.lang.ada:49906 Date: 2018-01-15T10:37:07+00:00 List-Id: Mehdi Saada <00120260a@gmail.com> writes: > This if statement exactly, seems to raise "ADA.STRINGS.INDEX_ERROR : > a-strunb.adb:782"(No indication of line, so I can't know more). That would be at line 782 of a-strunb.adb (the body of package Ada.Srings.Unbounded; I don't know why GNAT still uses the krunched form of file names, which was designed to fit DOS 8.3 file name limitations). function Element (Source : Unbounded_String; Index : Positive) return Character is SR : constant Shared_String_Access := Source.Reference; begin if Index <= SR.Last then return SR.Data (Index); else raise Index_Error; <<<<<<< line 782 end if; end Element;