Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Variable to tblsearch

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Anonymous
899 Views, 5 Replies

Variable to tblsearch

I have defined (setq VN 5) and wish to use it, calling (in this case ), a view with
(tblsearch "view" VN) but the tblsearch is not working. Can anyone help with the correct form?

Thanks for any help.

5 REPLIES 5
Message 2 of 6
dbhunia
in reply to: Anonymous

Try like this.......

 

(setq VN "5")

(tblsearch "view" VN)

 

Also check >>This<<


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 3 of 6
Anonymous
in reply to: dbhunia

Thanks dbhunia. That did work, but the whole routine inspects the view table, and calls views, then provides prompts according to the outcome. For the prompts, I am using messages such as:

(prompt (strcat "\n View " (rtos VN)" restored))

which works with (setq VN 5) but not (setq VN "5"), which returns:

error: bad argument type: number "5"

Message 4 of 6
cadffm
in reply to: Anonymous


@Anonymous  schrieb:

I have defined (setq VN 5)

a view with (tblsearch "view" VN) but the tblsearch is not working


With an error "Argumenttyp: stringp 5" what means "STRING wanted, but get 5" ?

The name of a view (the name of ALL NAMED OBJECTS) are STRINGs, but your symbol 'VN' refer to a number, an INTeger. The internal predicat-function for strings (stringp) returns NIL, nil nothing false fails.

 

Pretty basic knowledge and one reason more to learn the error messages, very usefull to find own mistakes.

 

Problem is known now, let's solve it.

What is the real name of your view, "5" ?

(tblsearch "VIEW" (itoa VN)) if VN is ever an integer

or

(tblsearch "VIEW" (rtos VN 2 0)) if sometimes integer, sometime real

 

 

Sebastian

EESignature

Message 5 of 6
dbhunia
in reply to: Anonymous

Ok.....

 

I did not Noticed your >>This<< post.......

 

In this case @cadffm  solution would solve the problem.......

 

As for the syntax 

 

(tblsearch table-name symbol [setnext])

 

symbol

Type: String

Symbol name to be searched for. This argument is not case-sensitive.

 

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
Message 6 of 6
Anonymous
in reply to: cadffm

Thanks Betreff-all working.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta