Author Topic: debugging a lisp collection, getting syntax errors  (Read 3908 times)

0 Members and 1 Guest are viewing this topic.

STEVEDALLAS

  • Guest
debugging a lisp collection, getting syntax errors
« 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?

SomeCallMeDave

  • Guest
Re: debugging a lisp collection, getting syntax errors
« Reply #1 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.

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: debugging a lisp collection, getting syntax errors
« Reply #2 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

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: debugging a lisp collection, getting syntax errors
« Reply #3 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.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

STEVEDALLAS

  • Guest
Re: debugging a lisp collection, getting syntax errors
« Reply #4 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?
« Last Edit: May 10, 2007, 08:43:16 AM by STEVEDALLAS »

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: debugging a lisp collection, getting syntax errors
« Reply #5 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.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

STEVEDALLAS

  • Guest
Re: debugging a lisp collection, getting syntax errors
« Reply #6 on: May 10, 2007, 12:31:42 PM »
Thanks everyone.