Announcement

Collapse
No announcement yet.

Comparing two pascal files gives many differences that aren't there

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparing two pascal files gives many differences that aren't there

    I have got two versions of a Delphi source code file that in my opinion are nearly identical (there is an ifdef'ed line in one that isn't in the other) but show up in BC as having many differences. The first thing I suspected was that one was unicode, the other ascii, but I used a hex editor to compare them and found no difference there either.
    I have attached a screenshot and the two files.
    Any hint?

  • #2
    Hello,

    Using the Factory Default Delphi format, the example files seem to compare as expected, with just the IfDef'd section as different. If you go to the Tools menu -> File Formats, select your Delphi format, then Save As (custom name), you can back up your current configuration. Then go to the original and use the Factory Defaults button to revert to our standard settings.

    Also, would you be running the latest BC3 release (3.3.12)? All BC 3.x updates are free for 3.x users.

    If you'd like to troubleshoot your customizations, click the cursor into the trouble text section. We'll display the detected grammar type at the bottom of the pane. If there is a difference of grammar between Left and Right, that is considered a difference, even if the text itself is equal.
    Aaron P Scooter Software

    Comment


    • #3
      I hereby reward you the crystal ball medal! You were absolutely right, I had (weeks ago) customized the Delphi file format in order for BC to ignore these lines. It didn't work and I had no time to troubleshoot, so I forgot about it and also left the error in there.

      Comment


      • #4
        btw: Shouldn't the grammar definition for "Compiler directive" in the factory default escape the "$" sign? Like this:
        Text from:
        {\$
        to:
        }

        (Text from is "{$" in the default.)

        Comment


        • #5
          It doesn't need to escape the $ sign because "Regular expressions" is not checked. If "Regular Expressions" was checked in the Grammar Item, then $ would need to be escaped with a \.
          Chris K Scooter Software

          Comment


          • #6
            Originally posted by Chris View Post
            It doesn't need to escape the $ sign because "Regular expressions" is not checked. If "Regular Expressions" was checked in the Grammar Item, then $ would need to be escaped with a \.
            In that case, why do I need to escape the $ sign in this case:

            Element name:
            Comment

            Category:
            Delimited

            Text from:
            {\$IFNDEF SIG_ABOUT_SHOWN}

            to:
            {\$ENDIF SIG_ABOUT_SHOWN}

            Escacpe character:
            <empty>

            no option checked

            (see also the screenshot attached)

            This is supposed to tread everything between these two lines as a comment. If I use the \$ escape, it works as expected, if I don't escape it, I get the effect that originally caused me to start this thread.

            I am using the latest BeyondCompare 3 version 3.3.12 build 18414

            Sorry to keep bothering you, it works now, but I am trying to understand why it didn't.

            twm

            Comment

            Working...
            X