How does the Line Comment Preceding Chars work?

How does the Line Comment Preceding Chars work?

2
NewbieNewbie
2

    Apr 15, 2005#1

    Hi

    I work on COBOL where the Comment begin with *. But the lines beginning with *# are not comments. So I try to use the tool "Line Comment Preceding Chars" but it doesn't work.
    In fact, I have the French version, and in the help, they say that if I put the following line,

    Code: Select all

    Line Comment Preceding Chars = [~#]
    that would work. But it's not the reality

    Code: Select all

    #*dsgsggsgg
    *#dsgfsgsgs
    I would like that the second line will not be a comment line.
    How can I do?
    thanks for your help
    Seb

    344
    MasterMaster
    344

      Apr 18, 2005#2

      Hi Seb

      It does work. preceding mean: standing before....

      so try: ~[*] instead of ~[#]

      I tried it with C, and a (nonsense) Line Comment Preceding Chars = [~\*] does this:

      // this is a comment
      *// this is NO comment

      Also, isn't it in Cobol that comments have to be in line 7 or something ?
      so you also could restrict comments to line 7 (or whatever...)

      rds Bego :wink:
      Normally using all newest english version incl. each hotfix. Win 10 64 bit

      2
      NewbieNewbie
      2

        Apr 18, 2005#3

        I don't think you have understand my problem.
        Usually line comment in COBOL begin with *.

        Code: Select all

        *sqjqsjjqsjfjq      (this is a line comment)
        But Some lines beginning with *# are not comment. I don't know if there is another function like "Line Comment Following Chars" for example that I can use to solve this problem.

        Code: Select all

        *dsfsdgfgg   (this is a comment)
        *#sdfgggg   (this is not a comment)
        thanks for your help
        seb (from france)

        63
        Advanced UserAdvanced User
        63

          Apr 18, 2005#4

          Hi Forgersn

          I program in RPG so we have a interesting situation.

          Code: Select all

          Line Comment = * Line Comment Valid Columns = [7]
          Lines are commented out if the '*' is in column 7

          I just checked and *# worked if * was in column 7.

          Hope this helps

          6,678585
          Grand MasterGrand Master
          6,678585

            Apr 18, 2005#5

            Looking for details about COBOL line comments with Google results in various information about what is a line comment for COBOL.

            One source says, that a single asterisk at column 7 or higher is a valid line comment and nothing about *#. An other source also knows about *> as comment and a single slash / for a special sort of command.

            Really interesting !!!

            OK, back to your problem. 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 asterisk) 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
            Best regards from an UC/UE/UES for Windows user from Austria