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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c31849ae55c4fb65 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!h54g2000cwb.googlegroups.com!not-for-mail From: "tr00per" Newsgroups: comp.lang.ada Subject: Re: Strings and errors... (gnat) Date: 29 Nov 2006 09:57:37 -0800 Organization: http://groups.google.com Message-ID: <1164823057.036164.238000@h54g2000cwb.googlegroups.com> References: <1164821430.144822.138100@h54g2000cwb.googlegroups.com> NNTP-Posting-Host: 85.89.170.2 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1164823062 3405 127.0.0.1 (29 Nov 2006 17:57:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 29 Nov 2006 17:57:42 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.7) Gecko/20060830 Firefox/1.5.0.7 (Debian-1.5.dfsg+1.5.0.7-2),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: h54g2000cwb.googlegroups.com; posting-host=85.89.170.2; posting-account=wvBz_g0AAACUkO5S7tNuLgLOWZKMbUvk Xref: g2news2.google.com comp.lang.ada:7748 Date: 2006-11-29T09:57:37-08:00 List-Id: Robert A Duff napisal(a): > You can't assign a shorter string into a longer one -- the lengths have > to match. You could do: > > tmp: String := buf(13..26); > > or > > tmp: constant String := buf(13..26); > > and it will take the bounds for tmp from buf(13..26). > > Or, you could use Unbounded_Strings. > > - Bob Actual length of the string is dependend on other data, range here is for example, so these declarations aren't solution for me, but thanks anyway. Maybe there is a ready-to-use function for splitting the string by template, so I don't have to reinvent the wheel? I have input in format String:String:String. I want to get rid of these colons and get three seperate strings.