Michael,
For the header, I would suggest using the in-line comment pair and perhaps
explain args/variables at the function, e.g.:
;|
This is my header...
blah, blah, blah
|;
(defun MyCoolFunc (Arg1 ; reason for this arg
Arg2 ; reason for this arg
/ Var1) ; purpose of this variable
...)
The "keynoted" comments are too hard to follow, IMHO...
--
R. Robert Bell, MCSE
www.AcadX.com
"Michael King" wrote in message
news:A946E2CB82F259299CCDDA8807CD944F@in.WebX.maYIadrTaRb...
| I just wanted to ask the group what styles of comments / level of
commenting
| they employ. I am a very thorough commenter (which comes of having a very
| poor memory) and inclue a function header which describes the function and
| line by line comments for all my functions. This helps alot but I end up
| spending more time writing / maintaining my comments as I do writing and
| maintaining my code. What are the thoughts of the group? I have included
a
| typical sample (a small function) of my code with comments and would like
it
| if others could do the same.
|
|
| ;;;--------------------------------------------------------------------;
| ;;; Function:-----VPLIMITS
| ;
| ;;;--------------------------------------------------------------------;
| ;;; Function which returns the model space coordinates of the lower ;
| ;;; left corner of an active viewport and the upper right corner of
| ;
| ;;; the same as a list containing two elements, each a point.
| ;
| ;;;
| ;
| ;;; EX. Command: (vplimits)
| ;
| ;;; ((-31.5033 -17.8231 0.0) (44.0824 27.1675 0.0))
;
| ;;;
| ;
| ;;; You can therefore use the CAR function to return the lower left
;
| ;;; corner and the cadr function to return the upper right corner
| ;
| ;;;
| ;
| ;;; NOTE: If this command is used in a polygonal viewport the
;
| ;;; returned coordinates will correspond to the model space
| ;
| ;;; corners of a box which would completly enclose the region
;
| ;;; viewed
| ;
| ;;;---------------------------------------------------------------------;
| ;;; [000] Beginning of function defintion VPLIMITS with no arguments ;
| ;;; and the following local variables:
| ;
| ;;;
| ;
| ;;; CFUNCTION: Used by the error function to tell which
| ;
| ;;; function was running when the error function
| ;
| ;;; was called
| ;
| ;;; VPOBJECT: Stores the Viewport object corresponding to the ;
| ;;; papers space viewport that was active when the
| ;
| ;;; function was called
| ;
| ;;; ODAXLL: Stands for Odeh ActiveX Lower Left and stores ;
| ;;; both the ActiveX safearray coordinate and the
| ;
| ;;; Visual LISP list coordinate of the lower left
| ;
| ;;; corner
| ;
| ;;; ODAXUR: Contains the same data as ODAXLL except for the ;
| ;;; upper right corner
| ;
| ;;; [005] Appends the quoted string to the tracer file and sets the
| ;
| ;;; CFUNCTION variable to the same
| ;
| ;;; [010] Captures the currently active Paper Space viewport and
| ;
| ;;; stores a pointer to the object in the VPOBJECT variable
| ;
| ;;; [015] The vla-getboundingbox function is used to capture the
| ;
| ;;; lower left and upper right coorinates of a box which
| ;
| ;;; completly surrounds the viewport, these coordinates are in
| ;
| ;;; paper space
| ;
| ;;; [020] The vlax-safearray->list function is used to change the
| ;
| ;;; ActiveX data type safearray into the Visual LISP data type
| ;
| ;;; list data type, the result replaces the variable being
| ;
| ;;; changed
| ;
| ;;; [025] See [020] above
| ;
| ;;; [040] Translates the coordinates from paperspace UCS to the model
| ;
| ;;; space UCS
| ;
| ;;; [045] See [040] above
| ;
| ;;; [050] End of setq function call
| ;
| ;;; [055] Reduce the tracer files indentation level
| ;
| ;;; [060] Return a list with the two points
| ;
| ;;; [065] End of function definition VPLIMITS
| ;
|
;;;-------------------------------------------------------------------------
| ---;
| (defun VPLIMITS (/ CFUNCTION VPOBJECT ODAXLL ODAXUR) ;[000]
| (setq CFUNCTION (TRACERAPPEND "VPLimits in Utilities.lsp"))
| ;[005]
| (setq VPOBJECT (ACTIVE "pviewport"))
| ;[010]
| (vla-getboundingbox VPOBJECT 'ODAXLL 'ODAXUR)
| ;[015]
| (setq ODAXLL (vlax-safearray->list ODAXLL)
| ;[020]
| ODAXUR (vlax-safearray->list ODAXUR)
| ;[025]
| ODAXLL (trans (trans ODAXLL 3 2) 2 1)
| ;[040]
| ODAXUR (trans (trans ODAXUR 3 2) 2 1)
| ;[045]
| )
| ;[050]
| (L-)
| ;[055]
| (list ODAXLL ODAXUR)
| ;[060]
| )
| ;[065]
|
| --
| Mike King
| Odeh Engineers, Inc.
|
|