3 Block Comment Strings

3 Block Comment Strings

5
NewbieNewbie
5

    Nov 15, 2014#1

    Hi forum,

    PeopleCode has 3 block comment string combinations: /* */, <* *>, and rem ;

    rem requires a trailing semicolon, for example:
    rem This is a comment;
    &string = "This is not a comment";
    Continue;
    Is there a way that I can configure UltraEdit syntax highlighting and code folding for this? I currently use:

    Code: Select all

    /L15"PeopleCode 8.4" PEOPLECODE_LANG Line Comment = rem Block Comment On = /* Block Comment Off = */ Block Comment On Alt = <* Block Comment Off Alt = *> Nocase String Chars = " File Extensions = PPL
    
    But this does not catch rem lines with a missing semicolon at the end. I would like it to highlight and fold everything after the "rem" at the start of a line as a comment until the next semicolon, for example:
    rem This is a comment
    &string = "This is not a comment";

    Continue;
    Thanks, Dan

    6,686585
    Grand MasterGrand Master
    6,686585

      Nov 15, 2014#2

      First, remove PEOPLECODE_LANG as this is a string not recognized by UltraEdit. The language markers really interpreted by UE/UES are listed all on help page with title Syntax Highlighting near bottom. All other languages simply do not have a language marker.

      Second, as long as rem is defined as begin of a line comment, code folding ignores rem as open fold string. UltraEdit ignores all strings in a comment, except those specified with

      Code: Select all

      /Open Comment Fold Strings = "..."
      /Close Comment Fold Strings = "..."
      But both strings must be found in a comment for comment string folding. And the comment starting strings itself cannot be included in the defined comment folding strings.

      Something like

      Code: Select all

      /L15"PeopleCode 8.4" Block Comment On = /* Block Comment Off = */ Block Comment On Alt = <* Block Comment Off Alt = *> Nocase String Chars = " File Extensions = PPL
      /Open Fold Strings = "rem"
      /Close Fold Strings = ";"
      enables code folding for a line containing rem to next line with a semicolon. But the disadvantage of this solution is that no line containing rem is now highlighted as comment.

      It would have been possible to highlight lines containing (starting with) a single character and containing (ending with) a single character as a comment (marker string) and get the starting character highlighted with a color like red if the ending character is not on same line.

      I am afraid that there is no solution to get a third block comment highlighting and folding for PeopleCode. I don't have any idea how to achieve that.
      Best regards from an UC/UE/UES for Windows user from Austria

      5
      NewbieNewbie
      5

        Nov 18, 2014#3

        Thanks, Mofi. The marker characters are an interesting idea that I didn't know about. I tried playing with them but they don't span over multiple lines, but they could be useful elsewhere.

        I ended up using rem ; as the alt block comment:

        Code: Select all

        /L15"PeopleCode 8.4" Block Comment On = /* Block Comment Off = */ Block Comment On Alt = rem Block Comment Off Alt = ; Nocase String Chars = " File Extensions = PPL
        
        I gave the Alt Comments a unique background color that would make them stand out if they span multiple lines. Then I added:

        Code: Select all

        /C6"CommentOuts"
        <*
        *>
        
        I gave them a yellow background so at least the start and end of the block stand out.

        Is there a way to select a block and set the color for the selected text? I would love a way to color code my files and especially my open file list.

        Thanks again, Dan

        6,686585
        Grand MasterGrand Master
        6,686585

          Nov 19, 2014#4

          danv wrote:Is there a way to select a block and set the color for the selected text?
          No. Highlighting works only based on syntax highlighting file. There is no method to select a block, define a color or background color for this block and UltraEdit remembers those settings anywhere in a separate file. Multi-line highlighting is supported by syntax highlighting only for block comments and for multi-line strings. That's it.
          Best regards from an UC/UE/UES for Windows user from Austria

          5
          NewbieNewbie
          5

            Nov 20, 2014#5

            I'll send a feature request to IDM. Thanks again, Mofi.