1 (edited by CDB 2020-02-23 06:27:03)

Topic: [SOLVED] MessageDlg error message

I am getting a messagebox error - Could not convert variant of type (Array Variant) into type (integer).


My code is:


MessageDlg('Are you sure you wish to DELETE Technician ' +frmMain.cmTechSelect.text, mtConfirmation,
 [mbYes,mbNo], 0);

I thought as it returns an integer, I'd try the above with Result:=. Same error message.


Then I tried just one button type, no joy, so I removed the reference to the combobox and still I get the error.


This is syntax that I have used in Delphi and it works.

{The Answer}

I suddenly realised that unlike Delphi or FPC , MVD sees [] as an array.


I changed the above to MessageDlg('Are you sure you wish to DELETE Technician '+frmMain.cmTechSelect.text, mtConfirmation,mbNo+mbYes,0);, and now everything works!

On a clear disk you can seek forever