guitarguy1685 Posted November 19, 2009 Posted November 19, 2009 When should I use (princ ) or (prompt ) ???? Quote
flowerrobot Posted November 19, 2009 Posted November 19, 2009 use Prompt when sharing the code with noobs. and princ when they now that there is no difference. Quote
David Bethel Posted November 19, 2009 Posted November 19, 2009 Actually (prompt) always returns nil (princ) only returns nil when called less a 'STR parameter. (and (setq a (+ 1 1)) (princ "\nI Want To Continue) (setq b (+ a 1)) (prompt "\nI'm Stopping Now) (setq c (+ b 1)) (princ)) With the 1st (princ) call, b is bound to (+ 1 a). Because of the (prompt) call, c is not bound to a value. With the last (princ) call, the function would return nil and exit cleanly. -David Quote
alanjt Posted November 19, 2009 Posted November 19, 2009 prompt (prompt msg) On dual-screen AutoCAD configurations, prompt displays msg on both screens and is, therefore, preferable to princ. I generally use princ since it won't interrupt and and statement. Here's another reason: Command: (prompt (list "A" "B" "D")) Error: bad argument type: stringp ("A" "B" "D") Command: (princ (list "A" "B" "D")) (A B D)("A" "B" "D") 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.