alijahed Posted May 13, 2010 Posted May 13, 2010 Hi All again, It is seriously weird! I used to programming with BASIC, it was much more sensible! Anyway, another strange thing: (defun c:prac2 (/ a) (setq a Y) (prompt "\nThanks") ) and I get: Command: PRAC2 Thanksnil what is "nil" for? Please help me before I give up :wink: Thanks in advance Ali Quote
MSasu Posted May 13, 2010 Posted May 13, 2010 Same issue as in your other post: (defun c:prac2 ( / a) (setq a Y) (prompt "\nThanks") (princ) ) Also take care that the Y variable may not bear a value (global variable), so a will be set to nil (it is already nil since is a local variable and wasn't assigned before). Regards, Quote
alijahed Posted May 13, 2010 Author Posted May 13, 2010 Same issue as in your other post: (defun c:prac2 ( / a) (setq a Y) (prompt "\nThanks") (princ) ) Also take care that the Y variable may not bear a value (global variable), so a will be set to nil (it is already nil since is a local variable and wasn't assigned before). Regards, Thanks mate I got it! now I have another question: I wrote: (defun c:prac2 (/ a) (setq a "Y") (prompt "\nThanks") (prompt a) (princ) ) and I get: Command: PRAC2 ThanksY How can I drop Y in the next line? Thanks Quote
MSasu Posted May 13, 2010 Posted May 13, 2010 All stings are returned on prompter, on the same line – try to switch to a new line to get it separated: (defun c:prac2( / a) (setq a "Y") (prompt "\nThanks") (prompt "\n") (prompt a) (princ) ) or (defun c:prac2( / a) (setq a "Y") (prompt "\nThanks") (prompt (strcat "\n" a)) (princ) ) Regards, Quote
TimSpangler Posted May 13, 2010 Posted May 13, 2010 (defun c:prac2( / a) (setq a "Y") (prompt "\nThanks[color="Red"]\n[/color]") (prompt a) (princ) ) Quote
jammie Posted May 13, 2010 Posted May 13, 2010 (defun c:prac2( / a) (setq a "Y") (write-line "Thanks") (write-line a) (princ) ) Just an alternative methoid. Prin1,princ,print would probably be the more typical choice though Quote
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.