alanjt Posted July 8, 2013 Posted July 8, 2013 getkword will never return "". It will either return what you've fed it with initget or nil. Quote
BlackBox Posted July 8, 2013 Posted July 8, 2013 getkword will never return "". It will either return what you've fed it with initget or nil. Correct... However, that would not cause an IF statement to 'bomb'... Methinks more information (perhaps the complete code?) need be posted. Quote
neophoible Posted July 9, 2013 Posted July 9, 2013 getkword will never return "". It will either return what you've fed it with initget or nil.OOPS! My bad. Sorry. Only getkword would return "". Should have been (if choice2 (setq 2xtxt choice2) (setq choice2 2xtxt)) Note reversal of setq's. If this doesn't help, then, as BlackBox mentioned, we would need more input, preferably the actual code. Quote
neophoible Posted July 9, 2013 Posted July 9, 2013 Correct... However, that would not cause an IF statement to 'bomb'... Methinks more information (perhaps the complete code?) need be posted.I think it is the culprit in this case, as the way I had it, the default was ignored when Enter or spacebar was used, and both variables were then set to nil, when both should be a string. Quote
alanjt Posted July 9, 2013 Posted July 9, 2013 OOPS! My bad. Sorry. Only getkword would return "". Should have been (if choice2 (setq 2xtxt choice2) (setq choice2 2xtxt)) Note reversal of setq's. If this doesn't help, then, as BlackBox mentioned, we would need more input, preferably the actual code. Did you look a the method I posed in post #19? http://www.cadtutor.net/forum/showthread.php?80320-Space-bar-as-enter&p=544038&viewfull=1#post544038 Quote
neophoible Posted July 9, 2013 Posted July 9, 2013 Did you look a the method I posed in post #19?If you are asking me, the answer is Yes. I don't know if the OP did or not, but his quote was of mine, which had the error you pinpointed. Thanks. If I was using your method, I would eliminate the strcat "2x" part, as it doesn't seem to be needed for the task. Also, yours seems to be missing a setq somewhere. I don't see where it maintains/updates the default, something I would certainly want to do if it were my program. What do you think? Quote
alanjt Posted July 9, 2013 Posted July 9, 2013 If you are asking me, the answer is Yes. I don't know if the OP did or not, but his quote was of mine, which had the error you pinpointed. Thanks. If I was using your method, I would eliminate the strcat "2x" part, as it doesn't seem to be needed for the task. Also, yours seems to be missing a setq somewhere. I don't see where it maintains/updates the default, something I would certainly want to do if it were my program. What do you think? Sorry. Forgot who the OP was. I put strcat'd the "2x" because I guess I was thinking that was what the end result was supposed to be. Good catch. I did miss a setq. I'm dumb. (post updated) I suppose this would be what is really wanted (lambda wrapper only there for testing): ((lambda (/) (initget 0 "6 8 10 12") (setq *choice* (cond ((getkword (strcat "\nSpecify framing size: 2x [6/8/10/12] <" (cond (*choice*) ((setq *choice* "6")) ) ">: " ) ) ) (*choice*) ) ) ) ) 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.