ODEY Posted June 23, 2010 Share Posted June 23, 2010 hello guys! need a little help. i wonder if it is possible to have a "default values" if my inputs are controlled by initget & getkword. does anybody have an idea? here is the sample code w/c is not working: (defun c:dvtest () (or dvdia (setq dvdia "8")); set global variable (initget "8 10 12 16 20 25 32 40");valid inputs (if (/= "" (setq strdia(getkword(strcat "\nEnter Bar Diameter <" dvdia "> ")))) (setq dvdia strdia) ) (princ "\nThe Bar diameter is ") (princ dvdia) (princ) ) and here is the sample code where inputs are not restricted by initget & getkword but is working: (defun c:dvtest2 () (or dvdia (setq dvdia "8")); set global variables (if (/= "" (setq strdia(getstring(strcat "\nEnter Bar Diameter <" dvdia "> ")))) (setq dvdia strdia) ) (princ "\nThe Bar diameter is ") (princ dvdia) (princ) ) Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 23, 2010 Share Posted June 23, 2010 Please check this thread. Regards, Quote Link to comment Share on other sites More sharing options...
ODEY Posted June 23, 2010 Author Share Posted June 23, 2010 i see. that was a quick response. got follow up question, in your sample code, can we include default value (prevoius selection). try to play w/ MLEADER command and you'll see what i mean. tnx. Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 23, 2010 Share Posted June 23, 2010 Just check the post #7 from above suggested thread. I have removed the code example from my post after found that thread (is more appropriate for your issue). Regards, Quote Link to comment Share on other sites More sharing options...
ODEY Posted June 23, 2010 Author Share Posted June 23, 2010 perfect! that was exactly what i'm looking for. next time, i'll try to search first if such thread is already existing before i post a question here. thanks a lot! Quote Link to comment Share on other sites More sharing options...
MSasu Posted June 23, 2010 Share Posted June 23, 2010 You're welcome! One tip, check the Similar Threads table at the bottom of thread. Regards, 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.