X-Received: by 10.236.34.233 with SMTP id s69mr109106yha.57.1410503053902; Thu, 11 Sep 2014 23:24:13 -0700 (PDT) X-Received: by 10.50.29.13 with SMTP id f13mr109996igh.15.1410503053805; Thu, 11 Sep 2014 23:24:13 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!m5no491828qaj.0!news-out.google.com!ef6ni2722igb.0!nntp.google.com!r10no574765igi.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.pascal.delphi.misc Date: Thu, 11 Sep 2014 23:24:13 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=223.30.5.13; posting-account=2EndfQoAAAApgEFNnbJhToQ0xyH8Y6wa NNTP-Posting-Host: 223.30.5.13 References: <917dbf9e-f5aa-4a84-ba56-b1c1ff3e354e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: display array values in a label From: Sandeepan Kashyap Injection-Date: Fri, 12 Sep 2014 06:24:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.pascal.delphi.misc:623 Thanks DoDi, I am actually an experienced Mumps/Cache developer and have to learn Delphi for a new project. I am actually trying to print a series of number in ascending order, e.g. 1,2,3,4,5,6,7,8,9 but in every number should print in new followed line. like 1 2 3 . I tried the below code. But the below code printing '0' always inside Label3, don't know why? what's is wrong with the code. Please enlighten me. type TIntegerArray = Array[1..9] of Integer; var x,y : integer; txt: string; i: integer; arrayOfIntegers : TIntegerArray; begin Form1.Color := clGreen; x := StrToInt(Edit1.Text); y := StrToInt(Edit2.Text); i := 1 ; begin while (i = 9) do arrayOfIntegers[i] := i; Inc(i); end; Label3.Caption := IntToStr(arrayOfIntegers[i]); I appreciate your reply. Sandeepan. On Thursday, September 11, 2014 7:16:05 PM UTC+5:30, Hans-Peter Diettrich wrote: > Sandeepan Kashyap schrieb: > > > > This code > > > > > Leng := Length(Edit1.Text); > > > SetLength(MyMatrix, leng); > > > for i := 1 to 3 do begin > > > begin > > > MyMatrix[i] := Edit1.text[i]; > > > end; > > > end; > > > end; > > > for i:= 1 to leng do begin > > > txt := txt + MyMatrix[i]; > > > end; > > > Label3.caption := txt; > > > > is equivalent to > > > > Label3.Caption := Edit1.Text; > > > > I don't understand what you want to do, please try to explain better. > > > > DoDi