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

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).

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.