very simple lisp

Did you set it up with an INITGET line? BTW why the STRCASE?
Reply to
Michael Bulatovich
Loading thread data ...
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
Reply to
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.
Reply to
roy
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

Reply to
Daniel Hargreaves
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?
Reply to
roy
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.
Reply to
Michael Bulatovich
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.
:)
Reply to
roy
(initget "Yes No") will enable the subsequent (getkword ...) statement to recognize any of the following:
Yes No Y N y n ... so the (strcase ...) function is redundant. ___
Reply to
Paul Turvill

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.