Jump to content

Recommended Posts

Posted

getkword will never return "". It will either return what you've fed it with initget or nil.

  • Replies 26
  • Created
  • Last Reply

Top Posters In This Topic

  • neophoible

    11

  • BlackBox

    7

  • alanjt

    4

  • spiker7221

    4

Top Posters In This Topic

Posted Images

Posted
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.

Posted
getkword will never return "". It will either return what you've fed it with initget or nil.
OOPS! :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.

Posted
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.
Posted
OOPS! :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

Posted
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?
Posted
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*)
                 )
  )
)
)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...