Jump to content

Known good code causes syntax errors in one file only?


Recommended Posts

Posted

This is really quite odd, I'm trying to work on a program and doing basic things are returning syntax errors.  

 

I was trying to create a list, with (setq lst (list 0.0 0.0)), and it was returning a syntax error.  I thought it was weird but it's a monday morning, so I went to the autolisp documentation and attempted to use the given code.

 

This is the result:

 

Command: (setq lst1 (list 1.0 "One" 1))
; error: syntax error

 

Why is this happening?  In another file everything is working fine, but this single file prevents me from using normal commands.  I've already tried cancelling a bunch of times in case I was stuck in a subroutine.  

Posted

Sometimes things get stuck have you tried closing down everything? I mean all the drawings in AutoCAD and AutoCAD itself.

Posted (edited)

Not a bad solution @mhupp. I don't know how else it would have been.

Edited by Jonathan Handojo
Posted

Because I write and test as I go crashes in code are frequent sometimes like as Mhupp has suggested I close everything and open again and code works. 

Posted
14 hours ago, BIGAL said:

Because I write and test as I go crashes in code are frequent sometimes like as Mhupp has suggested I close everything and open again and code works. 

 

and likewise a code that you have tested along the way 'works' until you restart everything (often a forgotten variable hanging about).... restart is always a good 'nearly finished' test of a code

  • Agree 1
Posted

Sounds like you've redefined a protected symbol - I would suggest enabling this option within the VLIDE to alert you to such:

image.png.8ac1b08c2b931e9f2a1278e9e46124e5.png

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...