skipsophrenic 发表于 2022-7-6 15:22:16

Afralisp tutorial #1 driving m

Hi all,
 
I've been reading up on .LISP for a bit now and decided to take the
plunge properly and learn it.
 
I have followed the afralisp tutorial to draw a line to the LETTER, and
AutoCAD is saying "; error: too many arguments"
 
What am i doing wrong?
 

(defun c:testline () ;Define Function(setq a (getpoint "\nEnter First Point : ""));Get the First point(setq b (getpoint "\nEnter Second Point : ""));Get the Second Point(command "Line" A b "");Draw the Line(princ);clean running) ;end Defun(princ);clean Loading

skipsophrenic 发表于 2022-7-6 15:28:25

SORTED
........................................................................
Original Code with error's
 

(defun c:testline () ;Define Function(setq a (getpoint "\nEnter First Point : ""));Get the First point(setq b (getpoint "\nEnter Second Point : ""));Get the Second Point(command "Line" A b "");Draw the Line(princ);clean running) ;end Defun(princ);clean Loading
 
code with error Fixed.
 

(defun c:testline () ;Define Function(setq a (getpoint "\nEnter First Point : "));Get the First point(setq b (getpoint "\nEnter Second Point : "));Get the Second Point(command "Line" A b "");Draw the Line(princ);clean running) ;end Defun(princ);clean Loading

paulmcz 发表于 2022-7-6 15:33:16

(defun c:testline () ;Define Function (setq a (getpoint "\nEnter First Point : "));Get the First point (setq b (getpoint "\nEnter Second Point : "));Get the Second Point(command "Line" A b "");Draw the Line(princ);clean running) ;end Defun(princ);clean Loading
 
An extra quot marks in red lines in your code

skipsophrenic 发表于 2022-7-6 15:34:31

cheers paul

flowerrobot 发表于 2022-7-6 15:38:42

From this error im assuming you are not using any program to play with them,
i use notpad ++ to make them. its good to see where ive got closed brackets and will run any where.
 
or
 
"_vlide"
 
Which is similar except colours are different, but allows to debug alot easyer, as it tells you where simple mistakes are, and easyer filtering where the bigger mistakes are. and reconises comands and variables
but you need autocad open to make work.

skipsophrenic 发表于 2022-7-6 15:41:10

I've decided to try learn it when i get free time at work (Which at moment is alot) so as to keep me "looking busy" LOL,

flowerrobot 发表于 2022-7-6 15:47:43

yep i kno what you mean.ive being working on many myself, till more work comes in,except my boss thinks its a waste of time.
hes a all tool bars man, who dosnt even do much work lol

JONTHEPOPE 发表于 2022-7-6 15:50:36

I never liked toolbars they take up to much screen space as for auto lisp have you looked at the The Visual LISP Developers Bible? pretty good stuff .a little hard to keep up for slow people like. me but it's worth it. everyone on here would agree i'm sure

Lee Mac 发表于 2022-7-6 15:53:30

I've had a look at that JON before and yes, it is pretty helpful.

skipsophrenic 发表于 2022-7-6 15:58:36

 
Never even heard of that book m8
页: [1] 2
查看完整版本: Afralisp tutorial #1 driving m