@wstowe wrote:
....
The third option is to list a variable without the /.
This means that a variable is set up to receive a value passed to it from outside the program. eg :
(defun DTR (a)
(* PI (/a 180.0))
)
....
[That needs a space between the / and the a -- there is no function called /a .]
I would word that differently. In this case, a is an argument, which is not really the same kind of thing as a variable. An argument must be fed in when the function is used; a localized variable is internal to the function's operations. The difference is the reason for the slash [if used] in the parentheses after the function name:
(defun WHATEVER (arguments if any go here / localized variables if any go here) ....
If there are no localized variables, that slash is not needed [as is the case with that (DTR) function]. If there are, but there are no arguments to be fed in, the slash is needed:
(defun WHATEVER (/ localized variables if any go here) ....
and that is typical of Command definitions beginning with (defun C:MickeyMouse (/ variables) .... which are not supposed to have arguments.
If a function definition lists an argument, you must feed in a value for it inside the parentheses when the function is called, in that case:
(dtr 45)
and the 45 will be used inside the routine wherever the argument a appears. Such function definitions can call for more than one argument -- you must supply a value for each in the order in which they are listed in the definition.
Kent Cooper, AIA