rwsice9 Posted May 9, 2013 Share Posted May 9, 2013 I'm hoping someone can help out with this one. I have a LISP that opens a DCL and prompts for user input, then sets the USERI2 variable. If I comment out the "if" function, the DCL works, and the USERI2 is set correctly. As soon as I put the IF back in, I get a "Bad Function" error that I cant seem to locate. Can any one help? DCL Code: notiftype : dialog { label = "Notification Type"; :column { : boxed_radio_column { label = "Notification Label Selection"; : radio_button { label = "Conventional Notification \"V\""; key = "nconv"; } : radio_button { label = "Addressable Notification \"A\""; key = "naddr"; } } } ok_cancel; } LISP Code: (defun c:INDCPLINE (/ r3 nconv naddr ) (setq r3 (getvar "USERI2")) (if (= r3 0) ( (setq dcl_id (load_dialog "notiftype.dcl")) (if (not (new_dialog "notiftype" dcl_id))(exit)) (action_tile "nconv" "(setq nconv $value)(setq nconv (atoi nconv))(setq naddr 0)") (action_tile "naddr" "(setq naddr $value)(setq naddr (atoi naddr))(setq nconv 0)") (action_tile "accept" "(done_dialog 1)") (action_tile "cancel" "(done_dialog 0)") (start_dialog) ; (unload_dialog dcl_id) ) ) (if (= nconv 1)(COMMAND "userI2" 1)) (if (= naddr 1)(COMMAND "userI2" 2)) ;(command "._pline") ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted May 9, 2013 Share Posted May 9, 2013 I didn't get your idea very well , but can you please try this at the moment ? (defun c:INDCPLINE (/ r3 nconv naddr) (setq r3 (getvar "USERI2")) (if (= r3 0) (progn (setq dcl_id (load_dialog "notiftype.dcl")) (if (not (new_dialog "notiftype" dcl_id)) (exit) ) (action_tile "nconv" "(setq nconv $value)(setq nconv (atoi nconv))(setq naddr 0)" ) (action_tile "naddr" "(setq naddr $value)(setq naddr (atoi naddr))(setq nconv 0)" ) (action_tile "accept" "(done_dialog 1)") (action_tile "cancel" "(done_dialog 0)") (start_dialog) (if (= nconv 1) (COMMAND "userI2" 1) ) (if (= naddr 1) (COMMAND "userI2" 2) ) ; (unload_dialog dcl_id) ) ) ;(command "._pline") ) Quote Link to comment Share on other sites More sharing options...
rwsice9 Posted May 9, 2013 Author Share Posted May 9, 2013 Well, for not "getting my idea", you still made it work Thank you VERY VERY MUCH! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted May 9, 2013 Share Posted May 9, 2013 Well, for not "getting my idea", you still made it work Thank you VERY VERY MUCH! You're welcome . It is good to replace the last two functions IF with cond function as the following : (cond ((= nconv 1)(COMMAND "userI2" 1)) ((= naddr 1)(COMMAND "userI2" 2)) ) Good luck . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.