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.66.63.68 with SMTP id e4mr1129086pas.40.1460449502639; Tue, 12 Apr 2016 01:25:02 -0700 (PDT) X-Received: by 10.157.3.17 with SMTP id 17mr9961otv.1.1460449502485; Tue, 12 Apr 2016 01:25:02 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!gy3no2622541igb.0!news-out.google.com!j7ni149igm.0!nntp.google.com!nt3no11527227igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 12 Apr 2016 01:25:02 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=128.39.191.70; posting-account=bPTmZAoAAAC_6HP9XLKB9aAAxBa6BuOR NNTP-Posting-Host: 128.39.191.70 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2055a188-fb5f-496a-ab37-b25d81cebe1b@googlegroups.com> Subject: Substrings as argument to procedures/functions From: reinkor Injection-Date: Tue, 12 Apr 2016 08:25:02 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:30081 Date: 2016-04-12T01:25:02-07:00 List-Id: Dear All, I believed that if a substring is an argument to a subroutine, then its "range" would start at 1 (and not inherited from the calling program). But this seems not to be the case. Given the following Ada source code: with Text_IO; use Text_IO; procedure t3 is package Int_Io is new Text_IO.Integer_Io (Integer); use Int_Io; procedure string_test1(S : String) is begin New_Line; Put(" In string_test1: "); Put(S'First,4); Put(S'Last,4); end string_test1; Str : String := "ABCDEF"; begin string_test1(Str); string_test1(Str(3..5)); end t3; The second call to "string_test1" gives: In string_test1: 3 5 (at least on my computer). Is this correct? And in case, is it "good" ? :-) reinert