I have a project on Lazarus that have two Forms, FormMain
and OutputForm
. I want to show a output on OutputMemo
at the second Form with this code:
procedure FormMain.ShowButton(Object: Sender);
begin
if SaveDialog1.Execute then
AProcess := TProcess.Create(nil);
AProcess.CommandLine := 'gcc.exe ' + SaveDialog1.FileName + ' -o ' TextField23.Text;
AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];
AProcess.Execute;
OutputForm.OutputMemo.Lines.BeginUpdate;
//OutputForm.OutputMemo.Lines.Clear;
OutputForm.OutputMemo.Lines.LoadFromStream(AProcess.Output);
OutputForm.OutputMemo.Lines.EndUpdate;
AProcess.Free;
end;
But when I try to compile this code, I got the error:
Identifier not found "OutputForm"
At the top of OutputForm unit I have:
unit Output;
And when I try to call it from FormMain unit(OutputForm: Output;
) I got this error:
Error in type definiition
What I have to do?