
04.06.2010, 01:44
|
Прохожий
|
|
Регистрация: 02.06.2010
Сообщения: 17
Репутация: 10
|
|
repeat-until
У меня написана программа с while а мне надо с repeat until... подскажите как сделать?
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Grids;
type
TForm1 = class(TForm)
StringGrid1: TStringGrid;
Label1: TLabel;
LabeledEdit1: TLabeledEdit;
procedure FormClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormClick(Sender: TObject);
const m=3; n=3;
type klop=array[1..m,1..n] of byte;
var x,y:klop;i,j,k:byte;
begin
i:=1;
while i<=stringgrid1.ColCount do
begin
j:=1;
while j<=stringgrid1.RowCount do
begin
k:=strtoint(labelededit1.Text);
x[i,j]:=strtoint(stringgrid1.Cells[i-1,j-1]);
if x[i,j]<0 then y[i,j]:=x[i,j]*k else
y[i,j]:=x[i,j];
label1.Caption:=label1.Caption+#9+floattostr(y[j,i]);
i:=i+1;
end;
j:=j+1;
label1.Caption:=label1.Caption+#13;
end;
end;
end.
|