Testing scripts and lisps

Testing scripts and lisps

townest
Advocate Advocate
2,846 Views
5 Replies
Message 1 of 6

Testing scripts and lisps

townest
Advocate
Advocate

What is the most efficient way to test scripts and lisps?  Thank you.  Tyler

0 Likes
2,847 Views
5 Replies
Replies (5)
Message 2 of 6

Jonathan3891
Advisor
Advisor

Run them in your drawing.


Jonathan Norton
Blog | Linkedin
Message 3 of 6

SeeMSixty7
Advisor
Advisor

I will add to that and say on a COPY of your drawing or drawings. That way if you do destroy your drawing, it's not a loss.

 

Good luck.

Message 4 of 6

CodeDing
Advisor
Advisor

Lol, I will also add to that, and say to get familiar with the Visual LISP IDE.

 

Best,

~DD

Message 5 of 6

dgorsman
Consultant
Consultant

In addition to the others: keep functions simple and modular.  Test them with expected inputs until they function.  Then when testing more complex functions that call already-tested functions, you only need to ensure arguments are correct (type, range, etc.).

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


Message 6 of 6

Sea-Haven
Mentor
Mentor

I am a bit hunt and peck write a few lines and test as I go, you can copy a line at a time to the command line, you can not paste (defun c:tool etc as it needs the closing ) But you can paste complete defuns directly. I have pasted 50 lines etc no probs.

 

Ok now for the bad news if you do it this way you can not have blank lines when pasting you can not have anything after the last ) in a line. You can have indented code but 1st copy point must be at ( as blank spaces are Enters.

 

Repeats set counter and start code after (Repeat ie (setq z (length lst)) copy till 1 short of repeat.

 

Use the ! to see what a variable value is !X = 4  !ans = "yes" !lst = (1 2 3 4)

 

Briscad has a nice indent in its Blade and should do more often to my code.

 

There is a way of stepping in VLIDE. Check help, Lee-mac.com has a nice Vlide tutorial. http://lee-mac.com/tutorials.html#vlide

0 Likes