Works fine for me.
BTW You do realise you can have
if MessageDlg('Are you sure you want to delete this book?',mtConfirmation,
[mbYes,mbNo],0) = mrNo then
abort;
I think I have also read somewhere that it is not recommended to encase the
if statements in () if you can help it. I am open for verification on that
one though.
-----Original Message-----
From: Patrick Dunford [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 15 June 2000 13:56
To: Multiple recipients of list delphi
Subject: [DUG]: Strange compiler error
The following code returns a compiler error.
procedure TLibData.BookTableBeforeDelete(DataSet: TDataSet);
var DoDelete : Word;
begin
MessageBeep(MB_ICONQUESTION);
DoDelete := MessageDlg('Are you sure you want to delete this
book?',mtConfirmation,
[mbYes,mbNo],0);
if (DoDelete = mrNo) then Abort;
end;
The message is on the line containing the Abort procedure call and reads
Statement expected, but expression of type 'Integer' found
The compiler was expecting to find a statement, but instead it found an
expression of the specified type.
remove "Abort" and the message disappears.
The Abort procedure is properly linked in from SysUtils, I can see no reason
why it would be taken to be an expression of type Integer. There are no
redeclarations of Abort anywhere in the application. Using D3.02
============================================
Patrick Dunford, Christchurch, NZ
EnzedRailWeb Sites
http://patrick.dunford.com/enzedrailweb/
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
CAUTION - This message may contain privileged and confidential information intended
only for the
use of the addressee(s) named above. If you are not the intended recipient of this
message you are
hereby notified that any use, dissemination, distribution or reproduction of this
message is prohibited.
If you have received this message in error please notify Progressive Enterprises Ltd.
immediately via
email at [EMAIL PROTECTED] Any views expressed in this message
are those of the
individual sender and may not necessarily reflect the views of Progressive Enterprises
Ltd.
This footnote also confirms that Progressive Enterprises Ltd. has swept this email
message for the
presence of computer viruses. This does not guarantee this message is virus free.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz