TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: STEVEDALLAS on May 09, 2007, 05:14:14 PM

Title: debugging a lisp collection, getting syntax errors
Post by: STEVEDALLAS on May 09, 2007, 05:14:14 PM
I am debugging a lisp collection of functions.
I keep getting syntax error.
Is there an easier way to do this without going through it letter by letter.
I like autocad's helpfulness, "syntax error". Does not say what, where, or anything.
This is a collection of some script routines that I have converted to lisp functions.
Anybody?
Title: Re: debugging a lisp collection, getting syntax errors
Post by: SomeCallMeDave on May 09, 2007, 05:46:30 PM
Try opening the file in the VisualLisp editor.  The syntax highlight will help and the 'Check Text in Editor' might help locate the problem(s)  too.

Just type VLIDE at the autocad command line, then navigate to your file and open it.
Title: Re: debugging a lisp collection, getting syntax errors
Post by: Jeff_M on May 09, 2007, 05:52:36 PM
Use the VLIDE, it makes dubugging MUCH easier. Opening this in the VLIDE you will immediately see that things between quotes is one color....if you see that color where it shouldn't be, find the missing/extra dbl quote.

There are also some strange characters used when calling (getvar "dimscale").....

Gibe the VLIDE a try and let me know how it works out.

SCMD beat me to it....but here it is anyway
Title: Re: debugging a lisp collection, getting syntax errors
Post by: TimSpangler on May 09, 2007, 09:37:36 PM
HOLY DEFUN'S BATMAN!!!   :-o :-o

I ran through it quickly in Notepad++ and found that there were allot of extra "'s in the file that would cause an error but I think the main failure was in this:

; MEP-hatch with the ANSI31 pattern
;
(defun C:ARJOHATCH (/)
(C:SAVELAYER)
(setq "dmscl2" (/ (getvar "DIMSCALE") 2) )
(prompt "Select Entity To hatch:")
(command "hatch" "ansi31" dmscl2 "0" pause "")
(C:RESETLAYER)
(princ))

I removed the ""'s from the var and it loaded fine

Here is the file, it seems to load fine I did drop some of the line to a new line so that the whole line would show in my editor.
Title: Re: debugging a lisp collection, getting syntax errors
Post by: STEVEDALLAS on May 10, 2007, 08:41:40 AM
Quote
Here is the file, it seems to load fine I did drop some of the line to a new line so that the whole line would show in my editor.

What does that mean, about the line?
Title: Re: debugging a lisp collection, getting syntax errors
Post by: TimSpangler on May 10, 2007, 12:22:05 PM
There were 2 routines that were so long on a single line that my editor cut them off so I couldn't see them to debug them so I had to enter them on a new line

ie

(command "a" "b" "c" "d" "e" "f")

went to this

(command "a" "b" "c"
"d" "e" "f")

It will not affect the program.
Title: Re: debugging a lisp collection, getting syntax errors
Post by: STEVEDALLAS on May 10, 2007, 12:31:42 PM
Thanks everyone.