a better way?

this is ugly, but it works to give me the default
values I want for width and height in my door routine.
  (setq    oc    
    pt     (getpoint "\nSet Point for Door
    w      (getint "\nDoor Width in
inches :<36>")
    ht     (getint "\nDoor Height in inches
    tr_wid (getreal "\n Enter Trim Width :")   
     txt    (cond
((= typ "E")  "Entry Door")
              ((= typ
"H")  "Half Glass")
              ((= typ
"F")  "Full Glass")
              ((= typ
"S") "Steel Door")
  (if (= w nil)
    (setq w 36)
  (if (= ht nil)
    (setq ht 80)
but I just know I had it slicker before. can't find a code
snippet of how I have done it before.
make me feel stupid, and help me tighten this up a bit. please.
* typ already constrained to the choices shown through initget
Reply to
Loading thread data ...
I usually stop at "it works" and rarely worry about elegance, so my hat's off to you Roy. The only thing that comes to mind is you could incorporate the if statements into the original setq's, and you could use (if(not W)... In terms of code it looks like a wash.
Reply to
Michael Bulatovich
A little shorter, not necessarily elegant:
(setq w (if w w 36)) (setq ht (if ht ht 80))
height in my door routine. (setq oc 1
I have done it before.
Reply to
Carl AK

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.