The issue there is that your procedure, pa (you really need to work on your identifier names) is not a class member of the TFrm2 class. So, it does not know about the TMemo.
Make that procedure a class member (untested) -
unit unit2;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, testpas;
type
{ TFrm2 }
TFrm2 = class(TForm)
mTest: TMemo;
procedure FormCreate(Sender: TObject);
private
procedure pa;
public
end;
implementation
{$R *.lfm}
{ TFrm2 }
procedure TFrm2.pa;
begin
mTest.Lines.Add('a');
end;
procedure TFrm2.FormCreate(Sender: TObject);
begin
pa;
end;
I have made two changes, firstly, declared pa up in the private section of TForm2's declaration. Second, I have added "TFrm2." in front of "pa" in the implementation. That way, Memo1 and pa, both being in the same class can see each other.
You probably need to have a bit of a read about the class/object syntax.
One suggestion, when posting demos of problems its a great idea to strip it down as you have done, good. But by using the names that the IDE gives these things by default, Unit2, Memo1, makes it easier for other people to see whats happening. (But, obviously, in your real app, give them sensible, descriptive, names).
Davo