tblsearch question..

C Witt

Usenet Archive
Joined
Jun 23, 2003
Messages
396
Reaction score
0
Using this function:
(tblsearch "dimstyle" "stylename")

Is there a way that it can search for "part" of a style name?.. ie:

(tblsearch "dimstyle" "sty") and if "stylename" exists, it will find it.

The reason is we have many stylenames with the same "start" but i want one search command to be able to return a "match" if it minds any of them.. rather than 30+ searches..
 
do you need a list of names? or a list of data?

; performs a wildcard match between the second
; element in dxf code 2 and [entry] for each
; entry defined in
.
;
- string, table name
; [entry] - string, entry name
; return - list, list of entity lists
; example: (wcTable "dimstyle" "stan*")
(defun wcTblnext (table entry / data rtn)
(setq table (strcase table))
(setq entry (strcase entry))
(while (setq data (tblnext table (null data)))
(if (wcmatch (strcase (cdr (assoc 2 data))) entry)
(setq rtn (cons data rtn))) )
(reverse rtn)
)

for a list of data
(setq data (wcTblnext "style" "st*"))

for a list of names
(mapcar '(lambda (x) (cdr (assoc 2 x))) data)
 
So we are back to the (if <then> <else>) expression.

(if (wcTablenext "dimstyle" "sty*")
; do your lisp
;else
; don't do anything.
)
 
right..

ok I tried that search command.. and got a syntax error..(whatever that is)
 
Could be the fact that I can't make up my mind on what the function name should be <g>.

(if (wcTBLnext "dimstyle" "sty*")
; do your lisp
;else
; don't do anything.
)

also, post what you tried.
 

Latest threads

Back
Top