Same Difference by S.Goodwin Copyright 1996/7 -- Abstract -- This programs loads two ASCII text files and highlights the differences between them both. The two files are listed side by side, allowing them to be compared and editted, by replacing, insert or clearing sections of the text. It is very useful tool for updating source code files, or checking alterations in a letter. -- Copyright Notice -- This software, and all its associated documents, is copyright 1996 by Steven Goodwin. The version provided here may be freely distributed as long as no files are edited or deleted, and the copyright notice contained herein is not modified. -- Basic Operation -- Two files are given, and are compared. This comparison operation works by looking at the first two strings. If they are the same, the program moves onto the next pair. If different, it then searchs for the string that is identical to it. Assuming it exists, both lists are then padded with blank lines so the identical strings appear on identical lines. This makes it easier for humans to spot the differences. -- Operating -- When the program is first run, the preferences appears... - Preferences - Each option pertains to the basic operation of Same Difference. Reading from the left: Scan Ahead Indicates the number of lines the program will read before continuing to another block. This is best left alone, unless you know how Same Difference works internally. Basically, use lower numbers if you have a lot of identical strings in your file. Ignore Blank This should be left on. This is helpful because (iwhen Lines selected) it allows the system to synchronise the files following differences. Without it, the files might not match for sometime. Case Sensitive When ticked, the strings 'Hello', and 'hello' will be different because the strings are compared exactely. When this is not selected, the case is completely ignored. Link Scrolls Moves scroll A, when you (the user) moves scroll B. And vice-versa. Include Termination String This just adds '< End Of File>' to the end. This is helpful because of the automatic padding that occurs you might see several blanks lines you do not recognise from your file. Buffer Size There are two requesters here, Lines The number of lines (after padding) Bytes Total data size. If the file is larger than either of these values, problems will occur. The 'after padding' comment is very important. If a file has a lot of changes, then you should increase the 'lines' value by up to double. There is very little memory overhead in doing this. Colours Indicates what colours are used to highlight the important bits of text. Save Saves the current settings into 's:'. Same Difference will use them upon the next load up. Use Utilise the settings for the current session, but it ignores them on following boot ups. Cancel Ignore any changes made. The last three buttons will all close the window. Upon startup, closure of this window will open another - the load window. - Load Requester - This window features two text requesters that accept the name of each file you wish to compare. To the right of these is a special button. This opens a file requester, that enters the selected file into the text box on its left. This window also holds a 'mask' entry box. This allows you to alter which files are visible in the file requester. By default, this shows you all the '.asc' files, but it can be altered to show the '.c', '.txt' or '.qppfjdhgf' files! This requester also supports combinations, such as '.c | .cpp' for files ending in *either* 'c' or 'cpp'. The not operator (~) is also supported, to exclude files (such as '~.info' to ignore all icon files). If the file requester shows no files, then either the directory is empty, or the mask is too restrictive. Use an empty to string to list all files. Hitting 'Compare' will then cause the software to start working, whilst 'Close' will exit the window. - The Main Screen - This shows two lists and a block of buttons. Each list shows the contents of one particular file, with the filename appearing above the list. Next to this name is a button marked 'Save'. This opens a file requester and saves the contents of that particular list to the filename given. The default name is as appears in the text requester on the main window. The list itself can be scrolled with the scroll bar, or the arrow buttons. When the gadget is released, the other scroll list will adjust itself to show the same portion of its list (assuming Link Scrolls is on, see Project Menu->Prefs). When you click on an item in the list the text appears in the requester underneath the scroll. This is now the 'selected' item, and is used to determine the actions of the operation buttons below the list. The buttons at the bottom of the screen refer to the operations. All operations affect the currently selected line, and the ones below it. You will also notice most buttons have a arrow (either '>' or '<') on it. This indicates the direction. For instance, 'Replace Line >' would replace the currently selected line into the list on the right. For a formal definition of the terms: Line - The currently selected line, and no more. Block - The currently selected line, and all those consecutively below it of the same type. That is, if the current line is hightlighted because it is different, a block would be this line, and each line below it that was different. As soon as a line is identical to the one in the other list (and the colour changes), the block ends. The terminology for the operations: Replace - Overright the contents in the other list with those selected. This will make both lines/blocks identical, and so will be re-coloured. Insert - Place the current line(s) before the opposing line(s) in the other list, and pad the current list to keep them the same size. For example: ... A ... A 1 B ---> 1 1 2 C 2 2 3 D ... (padding) B ... (padding) C 3 D ... denotes a blank line Append - Like insert, but adds the lines after the block. Clear - This operation does not affect the opposing list. It simply clears the line or block with empty strings. This in turn will normally make the strings in the opposite list change colour to indicate a difference. -- Menu Bar -- Whilst using the main window, there is a menu bar available (upon pressing the right mouse button). This has the following options: Open Calls the load requester. Prefs Opens preferences. About Tells you about the version number..and the fact you haven't registered. Quit Exits the program. -- The Final Word -- This program is shareware, you can use it for 30 days before paying for it. If, however, you want the source, or use it after this time then you must send me £5, and I'll return you a disc with all the source, the latest version, and any other utilities I've written that haven't been released yet. Now, Q. Where do I send my money? A. Steven Goodwin 105 St. Johns Road Clacton-on-Sea Essex CO16 8DB Q. What do I say? A. Try printing this off.... (or copying the relevant bits if you're without a printer) o/_________________________ CUT HERE ________________________________ O\ Your Name:_______________ Address :_______________ _______________ _______________ _______________ Hi Mr. Steven Goodwin, I would like to register my copy of Same Difference because a) I'm more interesting than a stick of celery. b) I'm funnier than a desert road from Vegas! c) I want to see you code AWE without using the AWE Shell. d) I need to debug your code !!!??!?! e) I have a tremendous guilt complex! f) All of the above (circle as appropriate) I enclose a cheque/postal order for £5 (which includes P&P) because I'm a kind hearted soul whos cares about the people who make my software. Thanks very much, Name ________________ (not completely necessary, but ties up the letter nicely) o/_________________________ CUT HERE ________________________________ O\ That's all folks!!!! See you on the next release...