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

lisp routine only work with step by step in vlide

7 REPLIES 7
Reply
Message 1 of 8
m.pepin
344 Views, 7 Replies

lisp routine only work with step by step in vlide

My routine crash with stringp nil as error message, but when I do a debug in vlide it works. The list that is supposed to be nil got values in it and the code ran well. Can somebody help me?

7 REPLIES 7
Message 2 of 8
pbejse
in reply to: m.pepin


@m.pepin wrote:

My routine crash with stringp nil as error message, but when I do a debug in vlide it works. The list that is supposed to be nil got values in it and the code ran well. Can somebody help me?



You're passing a nil value variable to a function that requires a string argument , but i guess you already know that.

 

I would think the way you test the value for the varaible in question is  by typing the variable name at the Visual Lisp console or !var at the command prompt. but. when you ran you;'re routine you declared that variable as local

 

(defun c:test (/ v1 v2 v3):<-----  which crashes somehow

 

What you see when you recall the value for that variable is a "left-over" and not the value the routine is using.

try running your code on a new drawing then you will see varialbe in question

 

or to debug Tools-Break On Error- and  Last Break Source (Ctrl+F9)

 

It would be easier If you post your code here. all it needs is fresh eyes.

 

 

Message 3 of 8
m.pepin
in reply to: pbejse

Here's the code, problem is at line 269. When you click OK or Accept on a dialog box the subroutine (srv-chainchk) suppose to give you T but I get ERROR. Thank you for your help.

Message 4 of 8
pbejse
in reply to: m.pepin


@m.pepin wrote:

Here's the code, problem is at line 269. When you click OK or Accept on a dialog box the subroutine (srv-chainchk) suppose to give you T but I get ERROR. Thank you for your help.



Without being able to test your code (missing subs/DCL)

I could tell the problem one iof these lines

 

(list "hautgal"    (get_tile "hautgal"))
(list "pentheo"    (get_tile "pentheo"))
(list "haut_sol"   (get_tile "haut_sol"))
(list "place_trav" (get_tile "place_trav"))


when you assign a none string value with  (set_tile "pentheo"   pentheo) and pentheo variable is nil and not ""

 

(get_tile "pentheo") will casue an error as it retrieves the current runtime value of a dialog box tile 

 

 

 

 

 

 

 

 

 

 

Message 5 of 8
m.pepin
in reply to: pbejse

Here's what I get when I put a break at line 269

Capture.PNG

 

and after a couple of step I get this

 

Capture1.PNG

 

The list dialst is all set to nil. Hope it can help.

Message 6 of 8
pbejse
in reply to: m.pepin

We'll do DCL tommorrow m.pepin

 

Cheers

Message 7 of 8
m.pepin
in reply to: pbejse

Thank you very much, but I've found my problem. It was the subroutine srv-chainchk that was defined in another lisp. So I have renamed srv-chaichk and now it works fine.

Thanks again.

Message 8 of 8
pbejse
in reply to: m.pepin


@m.pepin wrote:

Thank you very much, but I've found my problem. It was the subroutine srv-chainchk that was defined in another lisp. So I have renamed srv-chaichk and now it works fine.

Thanks again.


Oh..I see, now i felt  sheepish  enough not being to help you with your problem but the worst part is giving the wrong advise.

 

At any rate, good for you m.pepin. Smiley Happy

 

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

Post to forums  

Autodesk Design & Make Report

”Boost