Author Topic: Debug "Error Breaking" not functioning  (Read 1616 times)

0 Members and 1 Guest are viewing this topic.

Giuseppe Beatrice

  • Newt
  • Posts: 43
Debug "Error Breaking" not functioning
« on: February 02, 2016, 10:40:48 AM »
Thanks to a Lee tutorial, I use the flag "break in case of error" of the Visual lisp's Debug menu to test a lisp program and to find rapidly the instruction that had caused an error.
Strange to say, that flag, despite to its normal functioning in previous cases, it doesn't anymore...
Is there anyone that can help me?
Thanks in advance and I apologize for my bad English.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Debug "Error Breaking" not functioning
« Reply #1 on: February 02, 2016, 12:20:25 PM »
Strange to say, that flag, despite to its normal functioning in previous cases, it doesn't anymore...

You'll need to provide a little more information than that -

Do you receive an error when trying to use the option?
Does it set the break point but you are unable to use 'Last Break Source'?
What exactly is happening when you try to use the option?

Please provide a step-by-step description of your actions and where the problem occurs.

Giuseppe Beatrice

  • Newt
  • Posts: 43
Re: Debug "Error Breaking" not functioning
« Reply #2 on: February 03, 2016, 06:21:24 AM »
Lee, thanks for asking.
As regards the problem, everything happens as if the flag was not activated; the program stops and appears only AutoLISP error note detected.
Anymore, I do believe the problem was caused by the local redefinition of the variable * ERROR * within a project.
If I delete the feature, the problem disappears.
This was my local function *ERROR*:

Code - Auto/Visual Lisp: [Select]
  1. (defun *ERROR*  (msg)
  2.     (if (not *noresetvarsys*)
  3.       (RESET_VARSIST varsist_old))
  4.     (if *lst_ramitot*
  5.       (progn (AZZERA_VAR_PRG (LM:ListsUnion (list *lst_ramitot* *lnom_rambyp* *lnombypcomp*))) ;_azzeramento variabili create dal programma
  6.              )) ;_ ripristino variabili di sistema interessate dal programma (clayer etc...)
  7.     (if (not (member msg '("Funzione annullata" "quit / exit abort")))
  8.       (princ (strcat "\nErrore programma: " msg))
  9.       (princ "\nUscita anticipata da programma!!!"))
  10.     (exit)
  11.     (princ))

Perhaps the problem was caused simply by the command (exit) in the * ERROR * feature?
I'm really a goat, and I apologize for my false problems.


EDIT: Added code tags - John
Please see the following link for formatting code in your posts.
https://www.theswamp.org/index.php?topic=48309.0
« Last Edit: February 04, 2016, 03:51:30 PM by John Kaul (Se7en) »

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Debug "Error Breaking" not functioning
« Reply #3 on: February 03, 2016, 12:18:43 PM »
Perhaps the problem was caused simply by the command (exit) in the * ERROR * feature?

Yes, you should not call (exit) from within the *error* function, as the exit function will itself trigger evaluation of the *error* function; personally I avoid the use of (exit)/(quit) altogether.

Giuseppe Beatrice

  • Newt
  • Posts: 43
Re: Debug "Error Breaking" not functioning
« Reply #4 on: February 04, 2016, 02:39:12 AM »
Thanks for explanation, I appreciate a lot .
You are a very good teacher.