Array 2 Dimensi

array ……………….

var

Form1: TForm1;

M :array[1..2,1..3] of integer;

b,k :integer;

tv:string;

implementation

 

{$R *.dfm}

 

procedure TForm1.FormCreate(Sender: TObject);

begin

b:=1;k:=1;

end;

 

procedure TForm1.Button1Click(Sender: TObject);

begin

M[b,k]:=strtoint(edit3.Text);

tv:=tv+’ ‘+ edit3.Text;

if K=3 then

begin

listbox1.AddItem(tv,listbox1);

b:=b+1;

k:=0;tv:=”;

end;

edit3.Clear;

k:=k+1;

edit1.Text:=inttostr(b);

edit2.Text:=inttostr(k);

end;

 

procedure TForm1.FormActivate(Sender: TObject);

begin

edit1.Text:=inttostr(b);

edit2.Text:=inttostr(k);

end;

end.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: