View Full Version : Explain the difference between defun and defun c
David van Erk
2007-06-07, 06:04 PM
Hello,
Could somebody explain to me the significant difference between:
- DEFUN
- DEFUN C:
Any help would be much appreciated.
Thanks,
tyshofner
2007-06-07, 06:13 PM
Really no significant difference, essentially the only difference is:
DEFUN - used for internal routines (helper routines used in other functions)
DEFUN C: - used for main functions that you want to call from the command line.
**EDIT**
Oh and when defined using DEFUN the function can accept arguments.
Ty :mrgreen:
T.Willey
2007-06-07, 06:58 PM
**EDIT**
Oh and when defined using DEFUN the function can accept arguments.
Ty :mrgreen:
FYI..
Defun C: can be called with arguments also.
example
Command: (defun c:Test (string) (prompt string) (princ))
C:TEST
Command: (c:Test "\n Hello")
Hello
Command: test
; error: too few arguments
kennet.sjoberg
2007-06-07, 08:23 PM
You should have a look in this thread Anatomy of an AUTOLISP file, especially at this LINK (http://forums.augi.com/showthread.php?t=42122&page=2#post511587)
: ) Happy Computing !
kennet
David van Erk
2007-06-07, 10:36 PM
Great guys! I tried some out and got it.
Thanks
tyshofner
2007-06-07, 10:57 PM
FYI..
Defun C: can be called with arguments also.
Good to know...........Thanks!
Ty :mrgreen:
Terry Cadd
2007-06-08, 11:18 PM
Here is some related information on the subject. Read the first and last two paragraphs in the following Introduction to AutoLISP.
http://web2.airmail.net/terrycad/Tutorials/MyDialogs.htm#IntroAutoLISP
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.