berna uyan?k wrote:
Hi,
I started lazarus newly
Codes that I used is below:
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
Grids;

type

{ TForm1 }

TForm1 = class(TForm)
grid1: TStringGrid;
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;

var
Form1: TForm1;

implementation

{ TForm1 }

procedure TForm1.FormCreate(Sender: TObject);
var satir: integer;
sutun:integer;
begin
for sutun:=1 to grid1.ColCount do;
Try
for sutun:=0 to grid1.ColCount - 1 do .....

grid rows and cols are 0 indexed, so if you have 3 cols, they are numbered from 0 to 2, not 1 to 3.

You will find this in lots of places.

cheers,

John Sunderland
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to