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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7bf23c8e794b6462 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed01.chello.at!newsfeed02.chello.at!news.hispeed.ch.POSTED!not-for-mail Message-ID: <2837620.IpIkgfgtM2@linux1.krischik.com> From: Martin Krischik Subject: Re: STRING length Newsgroups: comp.lang.ada Date: Wed, 15 Nov 2006 17:28:48 +0100 References: <1163544675.070347.64490@h54g2000cwb.googlegroups.com> User-Agent: KNode/0.10.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Complaints-To: abuse@hispeed.ch Organization: hispeed.ch NNTP-Posting-Host: 80.218.118.14 (80.218.118.14) NNTP-Posting-Date: Wed, 15 Nov 2006 17:45:02 +0100 X-Trace: df541455b440ef57fd3ab25946 Xref: g2news2.google.com comp.lang.ada:7475 Date: 2006-11-15T17:28:48+01:00 List-Id: markww wrote: > Hi, > > How does one use a variable length string in ada? I created a record > like: > > type MY_RECORD is > record > m_strName : STRING(1..5); > m_strPhone : STRING(1..5); > m_strAddress : STRING(1..5); > end record; > > However when trying to assign the members of the record, at runtime I > may get an exception if the assigned string is not exactly 5 > characters. Is there a different STRING type which doesn't care how > long the assigned string is (as long as it's shorter than the max) or > which just grows to meet the assigned string length? http://en.wikibooks.org/wiki/Ada_Programming/Strings Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com