TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: 2e4lite on May 22, 2014, 11:40:57 PM
-
(setq lname (strcase (cdr (assoc 2 (tblsearch "layer" lay_chname)) ) ))
In any case, can remove the strcase above (is it superfluous)? why?
-
hi.. If the layer name is in numeric string like "0" "123", case unchanged.
so strcase can be ignored.
-
What if tblsearch returns nil?
-
What if tblsearch returns nil?
I was about to post that same question
Assuming lay_chname value is the result of a user typing the layername
(if (tblsearch "layer" (setq lname (strcase lay_chname)))
lname
)
-
Depends on what's being done with the value afterwards. If its being tested for equality against another string, then it could be important to do it or not, if case sensitivity is an issue.
-
Table name always ignore case when you use search or change entities's table name or make entities with it , like you use tblsearch / entmod / entmake .
Why we used strcase , just like dgorsman said , Easy to use these function which no ignore case , like wcmatch / = / member etc. .
-
@ 2e4lite: ?
-
I got it.Thanks you all.