line and block comment problem

line and block comment problem

5
NewbieNewbie
5

    Sep 20, 2005#1

    I'd like to add my signature into the code for modified part,
    the expectation is "//lk" and "//lkend" is the color1
    and "//" and "/*","*/" should has its owned color2,

    Code: Select all

    /* Modified sample */
    //lk
    // ch++;        // original
    ch--;             // modified
    //lkend
    As Mofi said in Multiple styles of commenting?

    I wrote the description in wordfile,
    /L1"C/C++" Line Comment = //lk Block Comment On Alt = /* Block Comment Off Alt = */ Line Comment Alt = // .......

    and I found, the ultraedit treats Line comment, Line comment Alt, Block comment ON/OFF as the same color, and Line comment as another,
    so, is there any suggestion? thanks~
    :D

    6,686585
    Grand MasterGrand Master
    6,686585

      Re: line and block comment poroblem

      Sep 21, 2005#2

      If I have understand your question correct this should work for you:

      Code: Select all

      /L1"C/C++" Line Comment Num = 3//  Block Comment On = /* Block Comment Off = */ Block Comment On Alt = //lk ...
      Note: There are two spaces after 3// !!!

      Because for the alternative block comment only the starting string is specified, the alternative block comments acts as additional line comment. And as you have already detected, only the alternative block comment has it's own color setting. All other 3 comment specifications have the same color.

      Disadvantage of this solution: original line comments are only highlighted as normal line comment, if a space is following //. For example //ch++; will be not highlighted as line comment anymore because no space is between // and ch++;.
      Best regards from an UC/UE/UES for Windows user from Austria

      5
      NewbieNewbie
      5

        Sep 21, 2005#3

        Thanks!!

        But it is not a perfect way,
        because many programmer may use TAB instead of SPACE,
        and as you(Mofi) said if the following character is NOT the SPACE,
        the color-highlight is malfunctioned.

        ex:
        //------------------------------------
        //[TAB]Name:
        // ......
        // ......
        //------------------------------------

        So, is there someone sent mail to UE and asking for the
        "Line Comment Following Chars=" ??
        I'm looking forward for it !!!!

        and I jusy confusing on why the color of Line Comment Alt is same as Line Comment ?