0

Hey,

I'm having trouble transferring a single row of data from a StringGrid through a Client/Server module and then add the row onto another StringGrid at the other side. I keep getting array errors which would make sense however surely you can just take a row and add a row?

Thank you

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by garden4ork
0

It is probably just a logic error in your code. Perhaps if you show some code, we can provide a fix (use code tags, and indicate where the error is).

0

I've messed about a little and got it half working, however now it decides not to copy each cell in the correct position

This puts data into form1

procedure TForm3.Button2Click(Sender: TObject);

begin
Memo2.Text := IntToStr(Count);

With StringGrid1 Do Begin


If Cells[0, 1] = '' then
 Cells[0, 1] := IntToStr(Count);
 CellCount := CellCount + 1;

If Cells[1, 1] = '' then
 Cells[1, 1] := Memo1.Text;

If Cells[2, 1] = '' then
 Cells[2, 1] := Memo3.Text;

If Cells[3, 1] = '' then
 Cells[3, 1] := Edit2.Text;

If Cells[4, 1] = '' then
 Cells[4, 1] := Edit3.Text;

If Cells[5, 1] = '' then
 Cells[5, 1] := Edit4.Text;




end;

This sends over the row

begin
        If ClientSocket1.Active then
                ClientSocket1.Socket.SendText(StringGrid1.Rows[1].Text);
   Countrow := Countrow + 1;
   StringGrid1.Rows[1].Clear;
  end;

It works, however the copying doesn't copy to the correct cells in the other stringgrid

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.