TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: jlogan02 on May 05, 2022, 04:31:59 PM

Title: I'm blind today or something
Post by: jlogan02 on May 05, 2022, 04:31:59 PM
I'm getting an "extra right paren" error. For the life of me I can't see it. I've just started using Visual Studio Code
and like the fact that it's showing the last closed paren (defun) in red, indicating something is wrong.

Help says to...
Click to the right of an open parenthesis or left of a closing parenthesis, and press Shift+Alt+RightArrow 2 (or 3) times. As I see it, the error is somewhere in my "error" handler, but I'm not seeing it.

Code - Auto/Visual Lisp: [Select]
  1. (defun C:LayGrpFltr ( / *error* )
  2.     (defun *error* ( msg )
  3.         (if (not (member msg '("Function cancelled" "quit / exit abort")))
  4.             (princ (strcat "\nError: " msg))
  5.         )
  6.         (princ)
  7.     )
  8.  
  9.     (rtos (getreal "\nPress Esc to exit, press Enter to force an error ..."))
  10.     (princ)
  11.     )
  12.     (setvar 'cmdecho 0)
  13.  
  14.         (command "._layer" "Make" "TBLK_BORD_LINES" "C" "WHITE" "TBLK_BORD_LINES" "")
  15.         (command "._layer" "Make" "TBLK_BORD_TEXT" "C" "GREEN" "TBLK_BORD_TEXT" "")
  16.         (command "._layer" "Make" "TBLK_TBLK_LINES" "C" "9" "TBLK_TBLK_LINES" "")
  17.         (command "._layer" "Make" "TBLK_TBLK_REFTEXT" "C" "GREEN" "TBLK_TBLK_REFTEXT" "")
  18.         (command "._layer" "Make" "TBLK_TBLK_REVLINES" "C" "9" "TBLK_TBLK_REVLINES" "")
  19.         (command "._layer" "Make" "TBLK_TBLK_REVTEXT" "C" "GREEN" "TBLK_TBLK_REVTEXT" "")
  20.         (command "._layer" "Make" "TBLK_TBLK_TEXT" "C" "CYAN" "TBLK_TBLK_TEXT" "")
  21.         (command "._layer" "Make" "IPCO" "C" "CYAN" "IPCO" "")
  22.         (command "._layer" "Make" "MFG" "C" "YELLOW" "MFG" "")
  23.         (command "._layer" "Make" "CLOUD" "C" "RED" "CLOUD" "")
  24.         (command "._layer" "Filter" "New" "Group" "" "TBLK_*" "ATT TBLK Layers" "")
  25.         (command "._layer" "Filter" "New" "Group" "" "FiberMgt,IPCO,Line0,Line1,Line2,Line3,Line4,Line5,MFG,Text0,Text1,Text2,Text3,Text4,Text5,Dimen,CLOUD,Image" "Stations Standard Layers" "")
  26.           (command "._layer" "Make" "LINE1" "color" "Yellow" "IPCO" "LOCK" "TBLK_BORD_LINES" "S" "LINE1" "")
  27.  
  28.         (setvar 'cmdecho 1)
  29.   (princ)
  30. )
Title: Re: I'm blind today or something
Post by: steve.carson on May 05, 2022, 04:34:25 PM
Line 11?
Title: Re: I'm blind today or something
Post by: jlogan02 on May 05, 2022, 04:57:36 PM
Beat me to it!!! I just found it myself. Thanks.

As an aside, in Visual Studio Code, I just discovered you can just put the cursor to the right of an open or left of a closed paren and it will highlight the matching paren.
Title: Re: I'm blind today or something
Post by: jlogan02 on May 05, 2022, 04:59:11 PM
Or left of an open, right of a closed...