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,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c0f26278da31ef9,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: "Rick Santa-Cruz" Newsgroups: comp.lang.ada Subject: Constraint Error Date: Thu, 30 Sep 2004 01:24:43 +0200 Organization: T-Online Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1096500302 00 16594 +jfkXY+vjRzwCYc 040929 23:25:02 X-Complaints-To: usenet-abuse@t-online.de X-ID: GhiuriZB8eqfZSYsJ52B8TMJtUYi53sDofq4Gi3xgT+GAv+4OCIxwE X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:4414 Date: 2004-09-30T01:24:43+02:00 List-Id: Hi, how can I avoid the Constraint Error, when executing the following code: with Messages; procedure Test_Messages is M1: Messages.Message; M2: Messages.Message; begin m1:=Messages.Create("This is a test"); m2:=Messages.Create("This is a second test"); end Test_Messages; ---------------------------- package Messages is type Message is tagged private; subtype String_Txt is String(1..20); function Create(Str: String) return Message; private type Message is tagged record Text: String_Txt; end record; end Messages; ------------------------------ package body Messages is function Create(Str: String) return Message is M: Message; begin M.Text := Str; return M; end Create; end Messages; The Constraint Error occurs in the Create-Function. Thanks in advance, Rick