1
Beginners / how to get class and method name from inside the method
« Last post by Joanna on Today at 10:04:21 am »hello i want to get information about where in program an error occurs for instanceis there any way to get the "PROCEDURE TWINCONTROL_HELPER.CREATE_THIS_CONTROL" string by some other means so i can sent it to an external error showing procedure such as
PROCEDURE SHOW_ERROR (CONST ERROR_MESSAGE);
BEGIN
showmessage(error_message);
halt;
END;
- PROCEDURE TWINCONTROL_HELPER.CREATE_THIS_CONTROL(CONST TYPE_TO_CREATE:TGUI_CONTROL_CLASS;
- VAR THIS_CONTROL: TCONTROL; CONST THE_NAME: SHORTSTRING);
- BEGIN
- IF (THIS_CONTROL <> NIL) OR (TYPE_TO_CREATE = TCONTROL)
- THEN begin
- ShowMessage('error in -> '+'PROCEDURE TWINCONTROL_HELPER.CREATE_THIS_CONTROL');
- EXIT;
- END;
- END;
PROCEDURE SHOW_ERROR (CONST ERROR_MESSAGE);
BEGIN
showmessage(error_message);
halt;
END;