I want to edit a property of a shape inside a procedure. However if I create my own procedure I get an "undefinded identifier" error.
I tried to edit the property in the OnCreate event procedure of my form and that works just fine.
Why is it like that and how can I fix it?
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls;
type
Tfrm_main = class(TForm)
shp_wheelLeftInside: TShape;
shp_wheelRightInside: TShape;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_main: Tfrm_main;
implementation
{$R *.dfm}
procedure addWheelInsides();
begin
shp_wheelRightInside.Height := 42; //this is where the error occurs
end;
procedure Tfrm_main.FormCreate(Sender: TObject);
begin
shp_wheelLeftInside.Height := 42;
shp_wheelRightInside.Height := 42;
addWheelInsides();
end;
end.
TShapeon your proc? - Ilyes