Announcement

Collapse
No announcement yet.

Grammar rules

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Grammar rules

    At times, it seems as if I take 1 step forward and 2 steps back with BC. (Don't get me wrong, I LOVE the product).

    In the attached capture, I'm comparing a PC file with a mainframe ditto. On the mainframe, the files are 80 characters (always), but often there is "garbage" in columns 73-80 as shown. I tried defining a grammar rule for my Cobol EBCDIC format. I tried one with columns 73-80 and one with columns 1-72 but neither of them got rid of the red colouring in cols 73-80.

    What setting do I need to tweak to get the file format to ignore columns 73-80 ????

  • #2
    Once the grammar element is defined, you need to mark it as Important (or Unimportant) in the Text Compare's Session Settings -> Importance tab. Checked items are important; unchecked are unimportant.

    So you would check col 1-72, and uncheck "Everything Else". Or check everything else and uncheck col 73-80.

    This should turn the differences blue. Then hide blue text by toggling Ignore Unimportant Differences in the toolbar.

    Here is a KB article with details on the process:
    http://www.scootersoftware.com/suppo..._unimportantv3

    Let us know if you have any questions.
    Aaron P Scooter Software

    Comment


    • #3
      Thanks Aaron

      After some mucking around, I managed to get what I wanted. Just so I didn't miss anything ...

      For the EBCDIC file format, I defined a grammar rule called Cols_73_80 and defined as columns 73-80.

      I then selected Session, Session settings and chose the Importance tab and saw that my grammar rule was included in the Grammar elements frame. I unticked it and left Everything else ticked and select Also update session defaults.

      After this, I seem to be seeing the results I expect (EXCEPT I don't see any blue guttering, but that's good for me) I include a screen capture of the results.

      I think I hadn't got my head round the idea of (un)ticking the grammar rules items. Do I understand it correctly if I say that a TICKED grammar rule is considered important when comparing files. If it's NOT ticked, it's still used, but any data "fitting" the rule is considered UNimportant instead.

      One final thing. If I export ALL options for my settings, are the rules included in the exported file ? The reason I ask is that I could save other BC users here a load of grief by getting them to import my settings whereupon they get my fileformats and grammar settings automatically.
      Last edited by misi01; 04-Jun-2010, 03:56 AM.

      Comment


      • #4
        Originally posted by misi01
        I don't see any blue guttering
        You have the Ignore Unimportant Differences button [] enabled on your toolbar. If you toggle this option off, your COBOL line number field will be blue instead of black.

        Originally posted by misi01
        If I export ALL options for my settings, are the rules included in the exported file ?
        Your grammar and importance rules will export correctly. However, the Ignore Unimportant Differences toolbar button [] is something that each user will need to toggle on their own as needed.

        Originally posted by misi01
        Do I understand it correctly if I say that a TICKED grammar rule is considered important when comparing files. If it's NOT ticked, it's still used, but any data "fitting" the rule is considered UNimportant instead.
        Yes, that is correct. The context of the checkboxes is the Importance tab. TICKED means important. NOT ticked means UNimportant. UNimportant grammar elements are still used... unticked elements cause blue difference highlighting when unimportant differences are not ignored. They also ensure that the text matching the unticked grammar elements is excluded from the "Everything else" category.

        Originally posted by misi01
        I could save other BC users here a load of grief by getting them to import my settings whereupon they get my fileformats and grammar settings automatically.
        You could... However, there is already a COBOL file format built into BC3 with the Line Number field already defined. They could use that format if they want to see other syntax highlighting (keywords, comments, etc.) without setting up or importing anything...
        BC v4.0.7 build 19761
        ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

        Comment


        • #5
          The unimportant button's last state is remembered for new Folder Compare sessions, so if it was already clicked, it would remain clicked.

          And, yes, checked items are important, and unchecked are unimportant. And an Export/Import is an effective way to transfer settings. If the setting already exists, it will not be included by default, so you will have to check that item manually during the wizard.
          Aaron P Scooter Software

          Comment

          Working...
          X
          😀
          🥰
          🤢
          😎
          😡
          👍
          👎