Did you set it up with an INITGET line? BTW why the STRCASE?
very simple lisp
May 29, 2006
7 Replies
I can
(setq mul (strcase (getstring "\n Mulls? Y/N: ")))
and the Yes / No does what I expect. but to have more options, say when I
(initget 1 "R L N") (setq hinge (strcase (getkword "\n Hinge? Right/Left/None: "))) )
that will fly.
getstring seems to have an exception for Y/N that WILL NOT apply to R/L.
don't see anything in the help files, is this all there is, or am I still missing some minutia?
thanks,
roy
oops, I need initget. don't know how I was deceived that the first one was working. irreproducable, that one.
and I need getkword. OK.
Also in your initget you can use the full word. (initget 1 "Right Left None") The capital letters represent the minimum that needed to be type. But the user can type the whole word.
Plus if you place the options in square brackets you can right click to select them (or in 2006 DYN they will pop up) - (setq hinge (strcase (getkword "\n Hinge? [Right/Left/None]: "))) One other note, the STRCASE forces the user to only use capital letters. I would suggest dropping that. If you are using it to validate the selection later in the LISP, convert it later.
Daniel Hargreaves, CSI, CDT, RAS
formatting link
when I use STRCASE it forces the text inputed to be caps, so I don't need something like:
(cond (or (= mull "y") (= mull "Y")) ...... )
not good?
It's perfectly fine. I *read* STRCASE, I even typed STRCASE, but in my head it was definitely STRCAT when I asked the question! My mistake.
you know, as I was typing in the code, I made the same mistake on one line. took forever to debug that line 'cos it looked right to these old eyes.
:)
(initget "Yes No") will enable the subsequent (getkword ...) statement to recognize any of the following:
Yes No Y N y n ... so the (strcase ...) functi>> It's perfectly fine. I *read* STRCASE, I even typed STRCASE, but in my
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required