[fpc-pascal] How to get to Range Check Error location
Honza
befelemepeseveze at gmail.com
Sat Oct 2 15:22:02 CEST 2010
2010/10/2 Juha Manninen (gmail) <juha.manninen62 at gmail.com>:
Hi Juha,
I just tried and can confirm that a LCL app running inside Lazarus
(r27491), having turned on range checks is able to perfectly catch and
show the place of an range check error (Ubuntu 10.04/AMD64). What I've
not tried, but suggest to try, is to open the Lazarus project in
Lazarus and run it as the tes app I'm talking above. Maybe then it
will show nicely also the range check error sources in Lazarus itself.
HTH
PS: The test app main form unit source
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
F: Byte;
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
F := F + 1;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
F := High(F);
end;
end.
--
bflm
freepascal-bits.blogspot.com
More information about the fpc-pascal
mailing list