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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4c049fca34123e80 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-15 14:27:06 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.mathworks.com!cyclone.swbell.net!nnrp2.sbc.net.POSTED!not-for-mail Message-ID: <3B7AE93A.3030506@qlippoth.zzn.com> From: file13 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.3) Gecko/20010801 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Variable length string References: <9l82gv$j83$1@news.mch.sbs.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 15 Aug 2001 16:27:22 -0500 NNTP-Posting-Host: 216.61.64.80 X-Complaints-To: abuse@swbell.net X-Trace: nnrp2.sbc.net 997910811 216.61.64.80 (Wed, 15 Aug 2001 16:26:51 CDT) NNTP-Posting-Date: Wed, 15 Aug 2001 16:26:51 CDT Organization: SBC Internet Services Xref: archiver1.google.com comp.lang.ada:11965 Date: 2001-08-15T16:27:22-05:00 List-Id: what you need is Ada.Strings.Fixed--as someone mentioned above.... Example: with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Fixed; use Ada.Strings.Fixed; procedure Tester is type List; type PList is access List; type List is record Data : Integer; Str : String (1 .. 20); Next : PList := null; end record; List1 : List; begin Move ("Howdy", List1.Str); -- Part of Ada.Strings.Fixed Put_Line ("List1.Str: " & List1.Str); end Tester; Unbounded and Bounded strings have their own ways to do the same thing. For more info check out http://www.adahome.com/rm95/rm9x-A-04-03.html -- file13 http://haxor.redcommandos.com/~file13/ -- "...war is about killing people and destroying things...that requirement is...best met through the use of Ada." Lt. Col. John A. Hamilton Jr. U.S. Military Academy http://www.stsc.hill.af.mil/crosstalk/1997/dec/languages.asp Shitij wrote: > Hi, > Iam new to ADA.I just wanted to know how do you define a variable length > string.I have declared a string array of length say a size of 20.But if I > use get and pass this string as an arguement,then unless and until I fill > this with exactly 20 characters my program is not working.How to overcome > this? > Iam using the below structure > > type list; > type pList is access list; > type list is > record > data:integer; > str:string(1 .. 20); > next:pList:=NULL; > end record;