Passes a list of arguments to a specified function and traps any exceptions
(vl-catch-all-apply 'function list)
Arguments
defun, or a lambda expression.
A function. The function argument can be either a symbol identifying aA list containing arguments to be passed to the function.
Return Values
vl-catch-all-apply returns an error object.
The result of the function call, if successful. If an error occurs,Examples
vl-catch-all-apply completes successfully, it is the same as using apply, as the following examples show:
If the function invoked by_$ (setq catchit (apply '/ '(50 5)))
10
_$ (setq catchit (vl-catch-all-apply '/ '(50 5)))
10
vl-catch-all-apply is that it allows you to intercept errors and continue processing. See what happens when you try to divide by zero using apply:
The benefit of using_$ (setq catchit (apply '/ '(50 0)))
; error: divide by zero
apply, an exception occurs and an error message displays.
When you usevl-catch-all-apply:
Here is the same operation using_$ (setq catchit (vl-catch-all-apply '/ '(50 0)))
#<%catch-all-apply-error%>
vl-catch-all-apply function traps the error and returns an error object. Use vl-catch-all-error-message to see the error message contained in the error object:
The_$ (vl-catch-all-error-message catchit)
"divide by zero"
*error*, vl-catch-all-error-p, and vl-catch-all-error-message functions. The Error Handling in AutoLISP topic in the AutoLISP Developer's Guide.
The