rodrigo_sjc_sp 发表于 2022-7-6 07:27:00

create an on error resume (esp

How to create in Visual Lisp anON ERROR RESUME NEXT a specific block
in C# i use

try {COMMAND ERRO}catch{// GO AHEAD , DONT BREAK}
 
Thanks
Rodrigo

Lee Mac 发表于 2022-7-6 07:47:54

Look into using vl-catch-all-apply
 
Please remember to use code tags...
 

Your code here

rodrigo_sjc_sp 发表于 2022-7-6 08:15:38

Sorry, thought it was only for use in large codes, I will do next time.
 
Do you have a simple example of vl-catch-all-apply ?
The examples I found on google are as difficult to understand much.
 
Thanks
Rodrigo

Lee Mac 发表于 2022-7-6 08:34:00

Silly example:
 

(defun c:test ( / num result )   (if (setq num (getint "\nChoose a number... just not zero: "))       (progn         (if (vl-catch-all-error-p (setq result (vl-catch-all-apply '/ (list 10.0 num))))               (princ "\nI told you not to choose zero!")               (princ (strcat "\n10 / " (itoa num) " = " (rtos result 2)))         )       )   )   (princ))
页: [1]
查看完整版本: create an on error resume (esp