How to highlight a line starting with spaces as comment?

How to highlight a line starting with spaces as comment?

31
NewbieNewbie
31

    Mar 21, 2019#1

    Hi,

    I'm trying to highlight lines that start with a specific character (colon) preceded by 4 spaces and lines that start with -- .

    My wordfile is:

    Code: Select all

    /L20"FANUC TPL" Line Comment = -- Line Comment Alt = ! String Chars = " Nocase File Extensions = KL LS
    And files that I would to highlight are for example:

    Code: Select all

      37:  --eg: fase prelievo pezzo grezzo
        :  dai nastri di ingresso ;
      38:  --****************************** ;
      39:  --eg: controllo di avere il
        :  consenso al prelievo e
        :  l'istanza della pinza a 0 ;
      40:  IF ( ) THEN ;   --> DON'T HIGHLIGHT
      41:  CALL xxxxxx ;   --> DON'T HIGHLIGHT
    
    Line 37 is correctly highlighted by means of Line Comment -- but I would highlight even the line between 37 and 38 that start with 4 spaces and a colon.

    I'm trying to use Line Comment Num but without success, can you help me?

    Thanks.

    6,626551
    Grand MasterGrand Master
    6,626551

      Mar 21, 2019#2

      I suggest to use:

      Code: Select all

      /L20"FANUC TPL" Nocase Line Comment Num = 5    : Line Comment Valid Columns = [1] Line Comment Alt = -- Line Comment Valid Columns Alt = [8] String Chars = " DisableMLS File Extensions = KL LS
      I added DisableMLS because I have doubts that the language of this file supports multi-line strings.
      Best regards from an UC/UE/UES for Windows user from Austria

      31
      NewbieNewbie
      31

        Mar 21, 2019#3

        Hi Mofi, thanks for suggestion! It works.

        Is it possible to highlight even lines that start with ! because my wordfile uses Line Comment = -- and Line Comment Alt = !?

        So:

        Code: Select all

          39:  --eg: controllo di avere il     --> HIGHLIGHTED CORRECTLY
            :  consenso al prelievo e          --> HIGHLIGHTED CORRECTLY
          40:  !Inizializzazione variabili ;   --> TO HIGHLIGHT IF POSSIBLE 
          41:  IF ( ) THEN ;                   --> NOT HIGHLIGHTED CORRECTLY
          42:  CALL CP_NASTRI    ;             --> NOT HIGHLIGHTED CORRECTLY
        Thanks.

        6,626551
        Grand MasterGrand Master
        6,626551

          Mar 21, 2019#4

          Yes, this is possible if it does not matter where in line an exclamation mark is found. It is not possible to add a third line comment definition with a valid column range definition.

          Variant 1 with everything from an explanation mark to end of line highlighted with color for comments.

          Code: Select all

          /L20"FANUC TPL" Nocase Line Comment Num = 5    : Line Comment Valid Columns = [1] Line Comment Alt = -- Line Comment Valid Columns Alt = [8] Block Comment On = ! String Chars = " DisableMLS File Extensions = KL LS
          Variant 2 with everything from an explanation mark to end of line highlighted with color for alternate block comments here used as third type of line comment:

          Code: Select all

          /L20"FANUC TPL" Nocase Line Comment Num = 5    : Line Comment Valid Columns = [1] Line Comment Alt = -- Line Comment Valid Columns Alt = [8] Block Comment On Alt = ! String Chars = " DisableMLS File Extensions = KL LS
          Best regards from an UC/UE/UES for Windows user from Austria

          31
          NewbieNewbie
          31

            Mar 21, 2019#5

            Yes, column of an explanation mark does not matter and your lines work perfectly! Thank you very much!