The block comment doesn't work for me.

The block comment doesn't work for me.

5
NewbieNewbie
5

    Jun 20, 2005#1

    I think it is because the line comment is ;
    and the block comment is ;|
    Any Fix?

    /L10"AutoLISP" Block Comment On = ;| Block Comment Off = |; Line Comment = ; Escape Char = \ String Chars = " Nocase File Extensions = LSP MNL
    /Delimiters = ~!@%^&()|{}[]" , .?
    /Indent Strings = "("
    /Unindent Strings = ")"
    /Function String = "(defun %[a-zA-Z_]*)[~]"

    6,683583
    Grand MasterGrand Master
    6,683583

      Jun 21, 2005#2

      Yes, your are right. At the moment there is no perfect solution. You could only use "Line Comment Num = 2; " (without the quotes - there are just to see the space after the semicolon) and make sure, there is always a space after the ; as line comment.

      You can do this by executing following regular expression replace in UltraEdit style:

      Find What: ;^([~ |]^)
      Replace With: ; ^1

      This regular expression adds also a space between block end and text, for example at a string like |;text. But this should not be a problem (result is |; text).

      Maybe you need also Line Comment Preceding Chars = [~|]
      Best regards from an UC/UE/UES for Windows user from Austria

      5
      NewbieNewbie
      5

        Jun 23, 2005#3

        Thanks for the reply.
        the Line Comment Num = 2; activated the block comment but killed the normal line comment.
        /L10"AutoLISP" Block Comment On = ;| Block Comment Off = |; Line Comment = ; Line Comment Num = 2; Escape Char = \ String Chars = " Nocase File Extensions = LSP MNL


        In LISP the number of ; are used in formatting
        ;;; 3 or more new line, no indent
        ;; 2 nornal indent
        ; 1 no indent, usualy found in a line of code
        Here is an example of code

        Code: Select all

        ;|
        SEE get-keyword.lsp for other examples...
        |;
        ;;;To keep text in reading position, I use something like:
        (and (> ang1 (* 0.583 pi)) (<= ang1 (* pi 1.583)))
        
        (defun asin (opp hypotenuse) ; line comment <----<<<
          ;;  normal indent <---<<<
          (atan opp (sqrt (- (expt hypotenuse 2) (expt opp 2))))
        )


        When I added Line Comment Preceding Chars = [~|]
        it killed all formatting

        I did not understand what you were trying with this
        Find What: ;^([~ |]^)
        Replace With: ; ^1

        When I tried it, it did not find any match

        Thanks again.

        6,683583
        Grand MasterGrand Master
        6,683583

          Jun 23, 2005#4

          OK. With the code example and the additional info, I think, I now have the correct definition for you.

          You added "Line Comment Num = 2; " instead of replacing "Line Comment = ;". I didn't have made clear, that only the normal OR the numbered line comment specification can be used, but not both at same time.

          This definition works for your example:

          Code: Select all

          /L10"AutoLISP" Block Comment On = ;| Block Comment Off = |; Line Comment Num = 2;  Line Comment Preceding Chars = [~;|] Escape Char = \ String Chars = " Nocase File Extensions = LSP MNL
          Please note the 2 spaces between 2; and Line.

          The regular expression does not find anything, because you have set Unix style as default for regular expression and my regular expression is for UltraEdit style. After reading the additional infos about usage of ';', you can forget it.

          Some additional info from me for you:

          ;| is not interpreted as line comment but as begin of a block comment, because there is not a space after ';'.

          |;code or |; code is not interpreted as line comment but as end of a block comment, because there is a '|' before the ';'.

          ;;;To keep text and ;; normal indent are not interpreted as line comments, because there is always a ';' before the last ';' and always not a space after the first ';'.

          But take always into consideration, that you have to write a space immediately after the ';', if you really want a line comment. For example
          ;line comment is not a line comment, but
          ; line comment is a line comment.

          Hope this helps and anything is clear.
          Best regards from an UC/UE/UES for Windows user from Austria

          5
          NewbieNewbie
          5

            Jun 23, 2005#5

            OK, it is picking up the block comment and the line comment ; .
            I must have mislead you on the use of multiple ;
            ;;; and ;; are still line comments. in fact anything with ; is a comment
            except ;| |; or within a string ";"
            its just that the ACAD formatter allows differing indents for ; ;; and ;;; but
            I don't care about the indent, just the syntax highlighting.

            Thanks for the help, very informative.

              Jun 23, 2005#6

              I played with some combinations of the info you provided but could not get it.
              Perhaps in a future version of UE.

              6,683583
              Grand MasterGrand Master
              6,683583

                Jun 24, 2005#7

                If ;; and ;;; are also line comments use this definition

                Code: Select all

                /L10"AutoLISP" Block Comment On = ;| Block Comment Off = |; Line Comment Num = 2;  Line Comment Preceding Chars = [~|] Line Comment Alt = ;; Escape Char = \ String Chars = " Nocase File Extensions = LSP MNL
                It contains the second line comment specification Line Comment Alt = ;; and the ';' is removed from the preceding chars definition.

                This definition works for your code example. I have tested it.
                Best regards from an UC/UE/UES for Windows user from Austria

                5
                NewbieNewbie
                5

                  Jun 24, 2005#8

                  Mofi,
                  You've done it when I thought it couldn't be done.
                  I've been living with these limitations for over a year.
                  I should have asked sooner.

                  One thousand 'Thank You' !!!! :D :D :D