try Dots[i].x := strtofloat(StringGrid1.Cells[0, i]); Dots[i].y := strtofloat(StringGrid1.Cells[1, i]); except MessageBox(0, pchar('abc'), pchar('xyz'), mb_ok); end;