TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: HasanCAD on July 21, 2014, 09:03:26 AM
-
I am createing, this part gives correct answer at first time but second time gives blank
(setq *str (cond ( (getstring (strcase (strcat "\nWhat is Stirrup Dia And repeatation? <" (setq *str (cond ( *str ) ( "T10@200" ))) ">: ")))) ( *str )))
-
I would do it this way.
(setq *str (cond (*str) ("T10@200")))
(setq *str (if (= "" (setq tmp (strcase (getstring (strcat "\nWhat is Stirrup Dia And repeatation? <" *str ">: ")))))
*str tmp)
)
Edit:
Found the problem.
getstring returns "" on ENTER and not nil
-
The same
(setq *str nil)
(setq *str (cond (*str) ("T10@200")))
(setq *str (cond ((getstring (strcat "\nWhat is Stirrup Dia And repeatation? <" *str ">: ")))))
when press Enter (without typing any data) the result is
nil
"T10@200"
""
-
Sorry i update code again, try that.
-
Also I question the placement of strcase? what is your intent?
-
Also I question the placement of strcase? what is your intent?
in case of the user types small letter and all letters should be ib capital
oopps I belive that it should be like this
(setq *str (if (= "" (setq tmp (strcase (getstring (strcat "\nWhat is Stirrup Dia And repeatation? <" *str ">: "))))) *str tmp))
-
OK in that case I updated the code again.
Is it working for you?
-
Here is how I would approach it:
Not dissimilar to those already posted...
-
Thanks CAB
Thnaks LEE
both working perfect
-
You're welcome Hasan :-)