
28.09.2012, 09:14
|
 |
Начинающий
|
|
Регистрация: 16.11.2008
Адрес: Российская Федерация!! :)
Сообщения: 165
Версия Delphi: Delphi 2010
Репутация: 1272
|
|
Код:
type
TForm1 = class(TForm)
Button1: TButton;
StringGrid1: TStringGrid;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure vGrids(j: integer; str: string; a:TStringGrid);
var i, si :integer; st:string;
begin
si:=0;
for i:=1 to Length(str)+1 do
begin
if (str[i]='~') or (i=Length(str)+1) then
begin
if j=0 then a.ColCount:= a.ColCount+1;
a.Cells[si,0]:=st;
st:='';
si:=si+1;
end
else st:=st+str[i];
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
vGrids(0,'12~12~3~456~23',StringGrid1);
end;
end.
Пользуйся. 
__________________
11011111 INED Home code
VK
|