lisp problem..

C Witt

Usenet Archive
Joined
Jun 23, 2003
Messages
396
Reaction score
0
I have this lisp file, that opens/runs a dialog box.. my problem is that I need to change it so that it can be "run" just by loading the lisp. I tried to remove the "defun c:dss" part.. but after the program runns.. it spits out an error.. "; error: bad argument type: numberp: nil"

Now I know that it's not any other lisp or the dcl file that causes this.. since it works fine with the "defun c:dss" in it.. but i NEED it without.. (unless someone can tell me how to invoke a lisp from inside a lisp with just the "command").

thanks

(setq dstyle 0)
(defun press
(if (= (get_tile "US24x36") "1")(setq dstyle 1))
(if (= (get_tile "US11x17") "1")(setq dstyle 2))
(if (= (get_tile "US8-1/2x11") "1")(setq dstyle 3))
(if (= (get_tile "Can24x36MET") "1")(setq dstyle 4))
(if (= (get_tile "Can11x17IMP") "1")(setq dstyle 5))
(if (= (get_tile "Can11x17MET") "1")(setq dstyle 6))
)

(defun check
(if (= dstyle 1)(load "US-IMP.lsp"))
(if (= dstyle 2)(load "US-IMP.lsp"))
(if (= dstyle 3)(load "US-IMP.lsp"))
(if (= dstyle 4)(load "MET.lsp"))
(if (= dstyle 5)(load "CA-IMP.lsp"))
(if (= dstyle 6)(load "MET.lsp"))
)

(defun c:dss ( / dcl_file msg )
(setq dcl_file (load_dialog "DimensionStyles"))
(new_dialog "DimensionStyles" dcl_file)
(action_tile "accept" "(press)(done_dialog 1)")
(setq what_now (start_dialog))
(cond
((= what_now 1)(check))
)
(princ)
)
(command "'graphscr")
 
Well the last line (command "'graphscr") is not valid should be (graphscr) ....and you can invoke a lisp within a lisp....(c:dss).....but i dont see where your error come from...maybe from the check result

C Witt a écrit :
 
C Witt said:
I have this lisp file, that opens/runs a dialog box.. my problem is that I need to change it so that it can be "run" just by loading the lisp. I tried to remove the "defun c:dss" part.. but after the program runns.. it spits out an error.. "; error: bad argument type: numberp: nil"

Did you also remove the corresponding closing parenthesis?
 
- i didn't remove the starting parenthesis.. why would I remove the closing?.. They are still needed to "group" the commands.. yes?..

On a side note, I have found another way of doing what I need (thus being able to leave this as-is).. though I would still like to know the solution incase i have to do it on another occasion.
 
To quote your original post:
"I tried to remove the "defun c:dss" part.. "

So I was simply asking if you removed the "(defun c:dss", that if you also removed the closing ")"
 
Yes I did remove "defun c:dss".. but not "(defun c:dss" the "(" remained.
 

Latest threads

Back
Top