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!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: confusing string error Date: Sat, 15 Feb 2014 09:33:25 +0000 Organization: A noiseless patient Spider Message-ID: References: <87ha81u9r7.fsf@adaheads.sparre-andersen.dk> <3kdtf9l42gimm37vgia3eibsmr638r27ig@4ax.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="f3a204fd0da52c1307d65ca023946f38"; logging-data="28054"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WsmZLwr+WXZjbV1pe8MUwnM/LLqe94iU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:kxZo0/RHhDSXj4uWhy3DwJIkr3c= sha1:m2xHzNtBAqVsvjp4Jgo8dmvG3XY= Xref: news.eternal-september.org comp.lang.ada:18572 Date: 2014-02-15T09:33:25+00:00 List-Id: agent@drrob1.com writes: > I was trying not to bomb the newsgroup. But it seems you want it. So > here we go. Assume that a valid spec file exists. I included the > relevent types I define in it in my comments, as it is in my actual > code. You are the one asking the questions, we are the ones who are trying to help. You do not make it easy; it just took me about half an hour to get the code you supply to the state where it compiles; and I still don't know what CAP is in Char.CH := CAP(Element(TKNBUF,CURPOSN)); so I just removed it (guessing it's supposed to convert to upper case). There is no problem if I enter "12345" or "abcde" or "1+2". However, if I enter "1+" or "1+2+" I get the same index error as Adam, on CH2 := Element(Token.UStr,2); Postponing this statement to the point where we know the length is greater than 1, I get no exceptions. Perhaps, for the purposes of asking the question here, you should change Testtokenizea so that the problematic input is a constant string rather than being read from the input. See for example http://stackoverflow.com/help/mcve - the 'minimal' isn't quite so important as the 'complete', 'tested', and 'readable'.