*error*

*error*

Anonymous
Not applicable
648 Views
1 Reply
Message 1 of 2

*error*

Anonymous
Not applicable

Hello, Community.

 

I studied *error* handling in last week.

When I tested it, I don't know what is mean msg variable.

 

(defun *error* ( msg )
(princ "\n*error* outside of test program.")
(princ)
)

 

(Lee-mac made the lisp.)

 

When I delete the msg variable.

That does not activate the function.

 

Thanks.

 

0 Likes
649 Views
1 Reply
Reply (1)
Message 2 of 2

cadffm
Consultant
Consultant

Its for compatibility, Acad errors give an message what going wrong, so you need one argument. Its your choice to use it.

 

 

(defun *error* ( )....

=> error "too many Arguments

 

Test:
(defun *error* ( msg )
(princ (strcat "\n*error* outside of test program. (" msg ")"))
(princ)
)

 

(/ 1 0)

or

(strlen 1)

 

 

 

Sebastian

0 Likes