6
I’m having trouble calling the next trial in my form
:
procedure TDM_Maquinas.IBDSMaquinasCOD_LINHASetText(Sender: TField; const Text: string);
begin
if Text <> '' then
begin
if Text = 'Linha 1' then
sender.AsInteger := 1
else if Text = 'Linha 2' then
Sender.AsInteger := 2
end;
end;
On the save button:
procedure TForm.salvar(Sender: TObject);
var
ValorLinha : Integer;
begin
ValorLinha := DM_Maquinas.IBDSMaquinasCOD_LINHASetText(DBComboBox2.Field, 'Linha 1'); //erro
end;
I’m on the wrong line:
E2010 Incompatible types: 'Integer' and 'Procedure, untyped Pointer or untyped Parameter'
If we change the type of the variable Valorlinha for String
the error persists.
A precedent does not return value and you are trying to assign the return to the Linevalue variable. You can turn Procedure into Function and return value or review its logic.
– Reginaldo Rigo