[lazarus] Problem

Shane Miller SMiller1 at stvgb.org
Tue May 4 16:08:12 EDT 1999


Come on folks, no quick answers to my last question?   :-) Someone out there must know of some stupid mistake I am making to cause this error....please let me know

Shane


>>> "Shane Miller" <SMiller1 at stvgb.org> 05/04 1:01 PM >>>
I am getting some errors when I don't think I should be and am asking for ideas.  Herre's an example.

In Editor.pp I have the following declaration:

TEditor  = class(TForm)
  public
  Memo1 : TMemo
  PageControl1 : TPageControl;
 TabSheet1 : TTabSheet;
 end;

In my code, I want to assign the memo width to the tabsheet's width so I do this:

Procedure TEditor.CreateMemo;
begin
Memo1 := TMemo.Crerate(TabSheet1);
Memo1.Left := TabSheet1.Left;
Memo1.Top := TabSheet1.Top;
Memo1.Width:= TabSheet1.WIdth;
Memo1.Height := Tabsheet1.Height;
end;

This does NOT work if I create the tabsheet in a procedure other than the one above.  If I create it in the one above where Memo1 uses it's sizes, then it works otherwise it throws an error.

So what I did was took the line 
TabSheet1 := TTabSheet.Create(PageControl1)
out of where it WAS and put it in this procedure.  Then it ran fine.  It compiles either way, it just doesn't run.

I am currently running into a similiar problem.  I create the TEditor and such.  Then another class calls a TEditor function.  I go into this function, display the caption of the form so I know that the TEditor 'self' is who I think it is, then I try to use Memo1.fcomponent and it crashes.  It works fine if I declase Memo1 global to the unit but not if I have it in TEditor's class declaration.

Any thoughts?  Seems odd.  Can I blame this on the compiler?  :-)

Shane




_________________________________________________________________
     To unsubscribe: mail lazarus-request at miraclec.com with
                "unsubscribe" as the Subject






More information about the Lazarus mailing list