a better way?

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title> </head> <body bgcolor="#ffffff" text="#000000"> <font face="Arial">this is ugly, but it works to give me the default values I want for width and height in my door routine.<br> <br> <font color="#cc0000">&nbsp; (setq&nbsp;&nbsp;&nbsp; oc&nbsp;&nbsp;&nbsp;&nbsp; 1<br> &nbsp;&nbsp;&nbsp; pt&nbsp;&nbsp;&nbsp;&nbsp; (getpoint "\nSet Point for Door :")<br> &nbsp;&nbsp;&nbsp; w&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (getint "\nDoor Width in inches :&lt;36&gt;")<br> &nbsp;&nbsp;&nbsp; ht&nbsp;&nbsp;&nbsp;&nbsp; (getint "\nDoor Height in inches :&lt;80&gt;")<br> &nbsp;&nbsp;&nbsp; tr_wid (getreal "\n Enter Trim Width :")&nbsp;&nbsp;&nbsp; <br> &nbsp;&nbsp;&nbsp; &nbsp;txt&nbsp;&nbsp;&nbsp; (cond <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= typ "E")&nbsp; "Entry Door")<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= typ "H")&nbsp; "Half Glass")<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= typ "F")&nbsp; "Full Glass")<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((= typ "S") "Steel Door")<br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br> &nbsp; )<br> &nbsp; (if (= w nil)<br> &nbsp;&nbsp;&nbsp; (setq w 36)<br> &nbsp;&nbsp;&nbsp; nil<br> &nbsp;&nbsp;&nbsp; )<br> &nbsp; (if (= ht nil)<br> &nbsp;&nbsp;&nbsp; (setq ht 80)<br> &nbsp;&nbsp;&nbsp; nil<br> &nbsp;&nbsp;&nbsp; )<br> <br> </font>but I just know I had it slicker before. can't find a code snippet of how I have done it before.<br> make me feel stupid, and help me tighten this up a bit. please.<br> <br> * typ already constrained to the choices shown through initget previous...<br> </font> </body> </html>
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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.
--


MichaelB
www.michaelbulatovich.ca
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
A little shorter, not necessarily elegant:
(setq w (if w w 36)) (setq ht (if ht ht 80))

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.