[lazarus] old delphi conversion & lrs

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jul 15 04:30:37 EDT 2002

On Sun, 14 Jul 2002 22:26:57 +1000
John August <johna at babel.apana.org.au> wrote:

> I'm still having problems, in that the structures set up by the lrs 
> file are not happening. Regardless of whether the { $I ...} statement
> is there or not, all that happens is that the default Form1, unlabelled,
> is set up, without any of the underlying structure. There's no caption,
> you cannot click and get anything to happen.

The simplest reason is that the wrong resource is looked up. But I guess you have already checked for the form name and classname ...

> Is there a way of finding out just what the .lrs file has setup ?

Add some writelns to the form constructor. For example:

constructor TForm1.Create(TheOwner: TComponent);
var i: integer;
  inherited Create(TheOwner);
  for i:=0 to ComponentCount-1 do begin
    writeln('i=',i,' Name=',Components[i].Name,':',Components[i].ClassName);

> Two (possibly related) questions :
> - If the files are named differently (case, using .PAS rather than .pp)
>   in the .lrs file, will this cause problems ? Would it be detected ?

Just look into the .lrs file, it is simple pascal code. The Lazarus resources are case insensitive.

> - Can you have a panel within the root (TForm1 / Form1) Form ? I have 
>   problems getting this to work, and I know the application wants to
>   set this up.

Just checked. TPanel on a Form works.

Maybe this will help:
- check if the line in the .lrs corresponds to your form. For example, if you declared the form variable: 
var Form1: TForm1;
then the .lrs file should contain a statement:
LazarusResources.Add('TForm1','FORMDATA', ... );


More information about the Lazarus mailing list