I create function in a unit that i created, like this :
function ConfirmMsg(MsgForm : TUniForm; strMsg : string) : Boolean;
var
fnConfirm : Boolean;
begin
Beep;
MsgForm.MessageDlg(strMsg, mtConfirmation, mbYesNo,
procedure(Res: Integer)
begin
case Res of
mrYes : fnConfirm := True;
mrNo : fnConfirm := False;
end;
end
);
Result := fnConfirm;
end;
when that function i call always return value true or mrYes, even though i chose button "no"
==
other case,
i created function in the same unit, like this :
function GetResultModalForm : Boolean;
var
intResult : integer;
//frmTest : TfrmTest;
begin
result := Null;
//frmTest := TfrmTest.Create(UniApplication); --> i made that syntac be comment, cause always return error
if frmTest.ShowModal(
procedure(AResult:Integer)
begin
if AResult = 1 then intResult:= AResult;
end
);
if intResult= 1 then Result = true else Result := False;
end;
two function above always return same value, why?
somebody can explain and correct my syntac