Line Compare
Line Compare takes two lines and shows exactly what is different
about them. Side by side, a change from > to
>= or from ll_customer_id to
ll_customer_no is easy to miss. Stacked and aligned, it is
not.
Opening it
- Compare ▸ Line Compare opens an empty one. Paste or type the two lines yourself.
- Navigate ▸ Compare Current Line (Ctrl+L) opens one loaded with the line pair you are on, from a File Compare.
- The same command from a Three-Way Compare, which sends the line the caret is on, against the Base: the version of the side whose column the caret is in, or for a Base line, of the side that changed it. Double-clicking a line does the same thing in both windows.
It opens as a tab like everything else. Compare ▸ Line Compare opens another tab rather than acting on the one in front, so two pairs of lines can sit side by side. Press F5 or the Compare button in the tool bar to compare the current contents of the two boxes.
The layout
The two input boxes are stacked, Old above New, and the result is below them. Both boxes are ordinary editable text, so a line can be typed, pasted or corrected in place. The splitter between the inputs and the result moves the space between them.
The tab itself holds nothing but those boxes. Its four controls are in the application's tool bar: the engine and language selectors, then Compare, which runs the comparison, and Swap, which exchanges Old and New. Each button shows its name, and its tool tip says what it does.
Reading the result
The two lines are shown one above the other, at the same left edge and in the editor font, so a run that was altered in place lands directly under the run it replaced. Runs that changed are shaded (the old line in the deleted colour, the new line in the added colour), and a marker at the left of each pair says what happened to it. Where one side has no line at all, only the other is shown.
The text is coloured by the language selector below, exactly as it is in a compare pane: keywords, strings, numbers and comments take the colours set under Options ▸ Appearance ▸ Syntax colours, including any set for that language alone. As elsewhere, change shading uses the background while the token class determines the text colour.
The status bar reports how many pairs were added, deleted and modified, or says that the two sides are identical.
It earns its place on a long line. PowerBuilder writes each DataWindow column as one statement on one physical line, often three hundred characters long, and a changed attribute in the middle of it is hard to find in a side-by-side pane. Select the column's line in a File Compare and press Ctrl+L: the two versions are stacked, and only the attribute that changed is shaded.
Compare engine
The first selector in the tool bar chooses how the line is broken up before comparison:
| Engine | Behaviour |
|---|---|
| Token by token | Tokenises both lines in the selected language and compares whole
tokens only. A token either matches or it does not, so
ll_customer_id against ll_customer_no reads as
one changed identifier rather than two changed characters inside a run
of matching ones. Best for real code, and the default. |
| Character by character | Compares individual characters, with look-ahead for runs that match. Best for a typo, a changed digit, a changed operator. |
Token mode needs to know the language, so a language selector sits next to the engine one in the bar: PowerScript, DataWindow syntax, XML, HTML, JavaScript, INI, or plain text. When Line Compare is opened from a comparison, the language of that comparison is preselected.
More than one line
The boxes accept multi-line input. Paste a short block into each side if the change you are chasing spans two or three lines.