I have the following piece of code that was written by a former co-worker:
It has now become necessary to actually trap and report the error that is thrown when the user gets the 'System can't accept check in at this time'. So I decided I would use another piece of code from another project, that actually reports the error:
But when I put it all together, I get an error:
This form of method call only allowed for class methods
Here's what I have:
I guess I need to create an instance of the Exception class? How would I do that?
Thanks!
leslie
Code:
Except
Pnl_Msg.Visible:= False;
Beep;
Form_Dialog.Caption:= ' Warning';
Form_Dialog.Lbl_Msg1.Caption:=
'System can''t accept check-in at this time';
Form_Dialog.Lbl_Msg2.Caption:= 'Please check-in with Courtroom Clerk';
Form_Dialog.Btn_Yes.Visible:= False;
Form_Dialog.Btn_No.Visible:= False;
Form_Dialog.Btn_Ok.Visible:= True;
Form_Dialog.ShowModal;
Btn_CheckIn.Enabled:= True;
FormActivate(Self);
Exit;
End;
It has now become necessary to actually trap and report the error that is thrown when the user gets the 'System can't accept check in at this time'. So I decided I would use another piece of code from another project, that actually reports the error:
Code:
except
on e:Exception do
begin
ShowMessage('Error Connecting to Database-' + e.Message);
end;
end;
But when I put it all together, I get an error:
This form of method call only allowed for class methods
Here's what I have:
Code:
Except
on e:Exception do
begin
TDMod.LogError(Now(), e.Message); //write time & error to log
Pnl_Msg.Visible:= False;
Beep;
Form_Dialog.Caption:= ' Warning';
Form_Dialog.Lbl_Msg1.Caption:=
'System can''t accept check-in at this time';
Form_Dialog.Lbl_Msg2.Caption:= 'Please check-in with Courtroom Clerk';
Form_Dialog.Btn_Yes.Visible:= False;
Form_Dialog.Btn_No.Visible:= False;
Form_Dialog.Btn_Ok.Visible:= True;
Form_Dialog.ShowModal;
Btn_CheckIn.Enabled:= True;
FormActivate(Self);
Exit;
end;
End;
I guess I need to create an instance of the Exception class? How would I do that?
Thanks!
leslie