Hi everyone! I'm using Google Translator (I speak portuguese).
Let's go there for my doubt.
It's the following ... I have a search form, which can be called by any other application form. So for this, the search form needs to know who called you.
Within the search form I have a procedure that will receive the form that called it and pass this information to a global variable (within the search unit), so that it can be used by other procedures.
Here is the search form call:
procedure TfrmCadPaciente.spdBtnLocalizaPaciente1Click(Sender: TObject);
begin
try
frmLocalizaPaciente := TfrmLocalizaPaciente.Create(frmCadPaciente); // criação do form de cadastro
frmLocalizaPaciente.FormQueChamou(Self); // passando o formulário de cadastro como parametro para a pesquisa
frmLocalizaPaciente.ShowModal; // chamando o formulário de pesquisa
finally
FreeAndNil(frmLocalizaPaciente);
end;
end;
Inside the search form, I have the following:
.
.
.
var
frmLocalizaPaciente: TfrmLocalizaPaciente;
ControlePaciente : TControlePaciente;
formulario : TForm;
implementation
.
.
.
procedure TfrmLocalizaPaciente.FormQueChamou(form: TForm);
begin
formulario := form; <== form.ExibeDadosBasicos OK - formulario.ExibeDadosBasicos ERRO
end;
.
.
.
As can be seen, form is a global variable, of type TForm, and receives the value of form that was passed as parameter.
If I write form.ExibeDadosBasicos, it works perfectly.
If I write formulario.ExibeDadosBasicos, it informs that it does not identify the ExibeDadosBasicos member. How is it possible???
formulario: = form
If it works with form, should not it work with formulario?
In this case does anyone have a solution?