Jump to content

How do I debug? Finding missing parenthesis?


ILoveMadoka

Recommended Posts

I have an acad.lsp file that I have been adding to for over 20 years and it has started giving me issues.

I did a search and found that there are 2 parenthesis missing.

I found that there were:

( = 10776
) = 10774

So two closing parenthesis are missing.

There are 8200 lines in the complete file.

I was looking in the VLIDE and there is a parenthesis matching but going paren by paren is going to take forever.

 

Once upon a time if a closing paren was missing you'd get a (_> type prompt.

That is not happening.

The last routine in the file has a "Loaded" prompt which does appear but a couple of the older routines don't work correctly now.

 

Is there a better way to find where the missing parenthesis should be?

 

I'd prefer to NOT upload the entire file if possible.

I'd like to be able to solve this myself (with some direction on how to accomplish this)

 

Please advise..

Link to comment
Share on other sites

8200 lines isn't small but manageable although I would recommend to go on a diet and demand-load some of your functions (if (not (c:...)(load "..."))

Anyways , you could double click at the beginning of each defun or just cut-copy-paste half of your file in a blanc document in de vlisp editor and run check on that file to see in which half the error is.

Link to comment
Share on other sites

If a princ statement at the end of the file displays correctly, parentheses must match. Note that parentheses can be used in strings and comments so counting occurrences of '(' and ')' is not the right way to diagnose the problem. Of course parentheses can be misplaced...

Link to comment
Share on other sites

Thanks..

 

I was able to isolate the two offending routines.

Everything is working great now.

 

I appreciate it..

 

Seems I remember years ago a program you could paste your code into and it would

show you that a closing paren was missing and show you where it should be...

That was long ago though...

 

 

Link to comment
Share on other sites

On 12/19/2018 at 11:19 PM, ILoveMadoka said:

 

 

Seems I remember years ago a program you could paste your code into and it would

show you that a closing paren was missing and show you where it should be...

That was long ago though...

 

 

 

Did you try Notepad++ ? It has nice Highlighting feature.

 

FWIW, in VLIDE I tend to use 'Ctrl+M' to locate/select matched parentheses

 

 

 

Link to comment
Share on other sites

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...