58

I use Beyond Compare (version 3.1.10) to compare different versions of Delphi Form Files, but I don't want to see differences concerning ExplicitTop, ExplicitLeft, ExplicitHeight and ExplicitWidth.

Details: These lines will always begin with a number of whitespace characters, then "ExplicitXXX = " and a number. Older versions of Delphi didn't have these lines, so I want to ignore differences where these lines are added to the newest version, and I also want to ignore differences where the number has changed.

Does anyone know how to do this?

Edit: Duplicate (more or less) of:

How do I configure BeyondCompare to ignore SCM replaced text in comments?

Community
  • 1
  • 1
Svein Bringsli
  • 5,640
  • 7
  • 41
  • 73
  • 1
    possible duplicate of [How do I configure BeyondCompare to ignore SCM replaced text in comments?](http://stackoverflow.com/questions/3652301/how-do-i-configure-beyondcompare-to-ignore-scm-replaced-text-in-comments) – Svein Bringsli Sep 08 '10 at 15:13
  • But with a better answer here IMO.... – Francesca Sep 08 '10 at 17:14
  • The other question is asking about matching text within other grammar items (comments, strings), and BC doesn't support nesting grammar items yet, so the solution here won't work there. – Zoë Peterson Sep 09 '10 at 14:43

4 Answers4

87
  1. Load a pair of DFM files showing the difference.
  2. Click the Session Settings button (aka Rules w/ umpire icon) or use the Session->Session Settings menu item.
  3. Switch to the Importance tab then click the Edit Grammar... button to open a second dialog.
  4. Click the New... button below the top listbox to open a third dialog.
  5. Change the Element Name option to something like Explicit*, change the Text Matching to Explicit(Left|Top|Width|Height) = \d+ and check the Match character case and Regular expression checkboxes, then click Ok, then click Ok again in the second dialog.
  6. Explicit* should now appear in the original dialog's Grammar Elements list. Uncheck it, then change the combobox at the bottom of the dialog from Use for this view only to Update session defaults.
Zoë Peterson
  • 13,094
  • 2
  • 44
  • 64
  • 3
    Fabolous answer, just what I was hoping for. You can't beat a good walkthrough :-) – Svein Bringsli Sep 08 '10 at 16:12
  • 5
    Especially when it comes from the horse's mouth himself. – LachlanG Sep 08 '10 at 20:47
  • 2
    Note that these instructions describe how to define the given text as "Unimportant", which (by default) will still be visible (and colored blue). You can ignore/hide Blue text with the "Ignore Unimportant Differences" toggle. – kmote Dec 03 '12 at 18:54
  • 1
    For more recent versions: http://www.scootersoftware.com/support.php?zz=kb_unimportantv3 btw if you could right click in a code file compare and apply for ex. a namespace difference as unimportant for that session (to apply to all code comparisons) that would be so sweet. – Adam Tuliper Dec 01 '14 at 22:22
9

I don't use Beyond Compare, but if you want to have newer versions of Delphi stop adding the (IMO useless) Explicit* properties, you can use Andreas Hausladen's DDevExtensions

jasonpenny
  • 2,999
  • 1
  • 24
  • 23
  • 1
    +1. I installed DDevExtensions some time ago to get rid of these properties and didn't regret it up to now. – Uli Gerhardt Sep 08 '10 at 14:24
  • 1
    That's part of the problem. Some of the developers on my team use this extension, others do not. – Svein Bringsli Sep 08 '10 at 14:32
  • @Svein: Can't you convince them that the Explicit* stuff is more than superfluous? – Uli Gerhardt Sep 08 '10 at 14:57
  • @Ulrich: I suppose, but it still doesn't answer the actual question. And in addition to the explicit values I would like to do the same thing with the ActivePage property of page controls, so I would like to find a solution to that also. – Svein Bringsli Sep 08 '10 at 15:08
3

In my case (C#), I wanted to ignore the entire line which contained namespaces (and thus, using's) which I changed. (Referenced Walkthrough - Ignore entire line if text exist in line

ie.

namespace INSERT.NAMESPACE.HERE 
      changed to 
namespace INSERT.NAMESPACE.HERE.NEW

To do that

In step 5. of Craig's solution, change the Text Matching to

" .\*INSERT.NAMESPACE.HERE.\* "

(include the quotes)

That's it.

kmote
  • 16,095
  • 11
  • 68
  • 91
Neville
  • 545
  • 1
  • 4
  • 19
3

Craig Peterson's answer is correct. N.B. However! The tab 'importance' is not always visible from Session/Session-settings. Always, from inside a Folder list view, it will not be there. It seems there are certain filetypes that do not have it either, though I'm less clear on that. BC has so many options and plugins I bet there is a workaround, but for me I have been ok so far. http://www.scootersoftware.com/vbulletin/showthread.php?t=8457

AnneTheAgile
  • 9,932
  • 6
  • 52
  • 48