PDA

View Full Version : error in my code


d_m_hopper
2007-10-08, 06:09 PM
Still trying to 'get' cond

I took a code that worked and editted it to this, just can't get it to run!

Anyone see my error? Please don't fix for me, I want to learn from my mistakes!

(defun c:ffd (/ inp) ;define command
(/ inp )
(initget "English Metric") ; ask for input
(setq Inp (getkword "\nWhat are the units of measure? [English/Metric] <English>: "))
(or Inp (setq Inp "English")
)
)


(cond
((= inp "English")
(load "C:\\home\\work\\dennis\\Lisp\\lisp routines\\flush floor duct pline hatch.LSP")
(C:ffplh)
)
((= inp "Metric")
(load "C:\\home\\work\\dennis\\Lisp\\lisp routines\\metric lisp\\M flush floor duct pline hatch.LSP")
(C:mffplh)
)
)

RobertB
2007-10-08, 06:24 PM
Look at the top of your code... the first two lines.

d_m_hopper
2007-10-08, 06:30 PM
Look at the top of your code... the first two lines.

deleted extra (/ inp)

removed ) after (or Inp (setq Inp "English")

added ) to end of code

works fine now thanks Robert, an extra set of eyes never hurts :mrgreen:


(defun c:ffd (/ inp) ;define command

(initget "English Metric") ; ask for input
(setq Inp (getkword "\nWhat are the units of measure? [English/Metric] <English>: "))
(or Inp (setq Inp "English")
)


(cond
((= inp "English")
(load "C:\\home\\work\\dennis\\Lisp\\lisp routines\\flush floor duct pline hatch.LSP")
(C:ffplh)
)
((= inp "Metric")
(load "C:\\home\\work\\dennis\\Lisp\\lisp routines\\metric lisp\\M flush floor duct pline hatch.LSP")
(C:mffplh)
)
)
)