Forum > General

RunError 201

(1/2) > >>

IIrmantass:
Hello when I try to compile my GUI program i get RunError 201

here is the code i can't figure out what is wrong because I'm new to programming like lazarus.


--- Code: ---unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption := '1st button was pressed';
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Label1.Caption := '2nd button was pressed';
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
Label1.Caption := '3rd button was pressed';
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
Label1.Caption := '4Th button was pressed';
end;

end.

--- End code ---

IPguy:
I had no issues running your code. (0.9.31-2.5.1, win32-Vista)

What version of Lazarus and fpc are you using? On which platform?

Here is a reference to the "RunError" codes:
http://community.freepascal.org:10000/docs-html/user/userch14.html


--- Quote ---201 Range check error
    If you compiled your program with range checking on, then you can get this error in the following cases:

       1. An array was accessed with an index outside its declared range.
       2. Trying to assign a value to a variable outside its range (for instance an enumerated type).

--- End quote ---

IIrmantass:

--- Quote from: IPguy on August 27, 2011, 04:39:53 pm ---I had no issues running your code. (0.9.31-2.5.1, win32-Vista)

What version of Lazarus and fpc are you using? On which platform?

Here is a reference to the "RunError" codes:
http://community.freepascal.org:10000/docs-html/user/userch14.html


--- Quote ---201 Range check error
    If you compiled your program with range checking on, then you can get this error in the following cases:

       1. An array was accessed with an index outside its declared range.
       2. Trying to assign a value to a variable outside its range (for instance an enumerated type).

--- End quote ---

--- End quote ---

Windows 7 64 bit lazarus 0.9.30

Bart:
There is an issue with range checking on 64-bit windows, see http://bugs.freepascal.org/view.php?id=20051.

Update to latest svn version (where the issue has been resolved) or disable range checking for the time being.

Bart

IIrmantass:
Okey updated that stuff, now next problem ... 

Navigation

[0] Message Index

[#] Next page

Go to full version