When you are ready to test this section as well, highlight it again and press the Uncomment Block tool. You can highlight the undesired portion and comment it out with the click of a button. Comment Block adds semicolons at the start of the selected lines Uncomment Block removes the semicolons.įor example, you may want to test just a portion of your routine in AutoCAD. To use these tools, simply select the lines you want to comment or uncomment and press the button. To automatically add comments after a closing parenthesis on a separate line, check the “Insert form-closing comment” box in the dialog under Tools>Environment Options> Visual LISP Format Options.Visual LISP automatically adds three semicolons in front of any comment starting at a blank line that is not indented, two semicolons when the new line is indented and one when tabbed over to a column location or after a closing parenthesis.
While just one semi-colon will do the job, some people prefer two or three for visibility.You may also want to break longer functions up into stages and explain what each stage does.At the beginning of the routine be sure to include a comment that states the filename, what the function does, the author, the date, and the version.
Anything on a line to the right of a semi-colon is ignored. Use a semi-colon in front of any line to add comments to a file. CommentingĬomments help you and anyone else reading the file to understand the code. You can set the formatting options under Tools>Environment Options> Visual LISP Format Options. (command “line” PT1 PT2 PT3 “c”)) Formatted routine: You can either Format edit window or Format selection.ĪutoLISP ignores spaces and carriage returns, so use them to make the routine more understandable to the programmer. They automatically insert tabs and spaces where needed to give you added clarity and help you track parentheses. But Visual LISP includes helpful formatting tools. When creating AutoLISP routines, the programmer should keep in mind not only correct syntax, but also a well-structured program that is easy to comprehend, forgiving of mistakes, easy to debug, and easy to edit. Explanation: the (atoms-family) function.Explanation: the (defun) function options.