Today I installed the latest version of fpspreadsheet from lazarus snapshot 5845. Lazarus was not changed.
My program now crashes on a statement:
Beheer1ItemForm.DetailWorksheet.WriteText(0,0,'Hoofding');
The debug message is:
Project raised exception class 'EListError' with message List index (1) out of bounds.
In file '.\include\wincontrol.inc' at line 7497
AWinControl := TWinControl(FControls.Items<openbracket>i<closebracket);
Before the new installation of fpspreadsheet my program worked fine.
Did I miss some necessary changes in my program to work with the later release of fpspreadsheet?
Here the basic structure:
unit main;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, StrUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus, Registry,
ComCtrls, ExtCtrls, ActnList, Buttons, StdCtrls, fpspreadsheet, fpsallformats,
fpspreadsheetctrls, fpspreadsheetgrid, fpstypes, Grids, lclintf, LCLType, MouseAndKeyInput;
...
implementation
{$R *.lfm}
{ TMainForm }
uses
Beheer1Item;
...
procedure TMainForm.OpenMenuItemClick(Sender: TObject);
...
Beheer1ItemForm.DetailWorksheet.WriteText(0,0,'Hoofding'); // ****** the problem statement
----------------------------------------------------------------------------------
unit Beheer1Item;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Windows, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, Variants,
StdCtrls, Grids, main, fpspreadsheet, fpstypes, fpspreadsheetctrls, fpspreadsheetgrid;
type
{ TBeheer1ItemForm }
TBeheer1ItemForm = class(TForm)
AnnuleerButton: TButton;
DetailWorksheetGrid: TsWorksheetGrid;
public
{ public declarations }
DetailWorksheet: TsWorksheet;
end;
implementation
...
procedure TBeheer1ItemForm.FormCreate(Sender: TObject);
var
i: integer;
begin
DetailWorksheet := DetailWorksheetGrid.Worksheet;
...