+ Reply to Thread
Results 1 to 2 of 2

Thread: Self Survey on my use of the commad {Search, Compare Buffers}.

  1. #1
    Senior Member
    Join Date
    Nov 2014
    Location
    Minneapolis, MN
    Posts
    290

    Self Survey on my use of the commad {Search, Compare Buffers}.

    Dear All,

    I would like to give a self survey on my use of the menu command {Search, Compare Buffers}.

    In short, a big thank you to Pauli for his Buffer_Switch.vdm macro. I find it a great help in using the {Search, Compare Buffers} command.

    Here are the details.
    1.: Let me start with the description of that menu command from the Vedit User Manual:

    To compare two buffers (files):
    1. If necessary, switch to both buffers and ensure that the cursor in each
    buffer is in the correct position for starting the comparison. Remain in
    either buffer.
    2. Select {SEARCH, Compare buffers} (<Ctrl-F3>). If only two buffers
    are open, the comparison starts immediately and you should notice that
    the cursor has moved over all matching characters.
    If more than two buffers are open, you are prompted for the “other” buffer
    number with the buffer selection dialog box.


    2.: The feature that I really like is that

    "If only two buffers are open, the comparison starts immediately "

    In this special case there is no need for any user intervention. In other words, there is no need to use Pauli's macro.


    3.: Now take the special case of three buffers are open. Then, as per the manual, you have the option of entering the buffer number into the selection dialog box.

    If you have many differences between the two files being compared then this strategy may not be the optimal one. The reason being that at each step you have to enter
    the buffer number.

    4.: Many times a better strategy is to use Pauli's macro. That is to say, close the buffer not needed in the comparison. This reduces the case of three buffers to the case of two buffers
    , where no user input is needed.

    5.: Note that there are many excellent third party comparison programs. However, for these programs you have to enter the names of the two files that you wish to compare. So if you are a poor typist like myself, then this is a typo prone procedure.


    -peter
    Last edited by rejto12; August 30th, 2017 at 12:27 AM. Reason: correct typo

  2. #2
    Senior Member
    Join Date
    Nov 2014
    Location
    Minneapolis, MN
    Posts
    290

    A possible solution in a typical specialcase.

    Quote Originally Posted by rejto12 View Post
    Dear All,

    I would like to give a self survey on my use of the menu command {Search, Compare Buffers}.

    In short, a big thank you to Pauli for his Buffer_Switch.vdm macro. I find it a great help in using the {Search, Compare Buffers} command.

    Here are the details.
    1.: Let me start with the description of that menu command from the Vedit User Manual:

    To compare two buffers (files):
    1. If necessary, switch to both buffers and ensure that the cursor in each
    buffer is in the correct position for starting the comparison. Remain in
    either buffer.
    2. Select {SEARCH, Compare buffers} (<Ctrl-F3>). If only two buffers
    are open, the comparison starts immediately and you should notice that
    the cursor has moved over all matching characters.
    If more than two buffers are open, you are prompted for the “other” buffer
    number with the buffer selection dialog box.


    2.: The feature that I really like is that

    "If only two buffers are open, the comparison starts immediately "

    In this special case there is no need for any user intervention. In other words, there is no need to use Pauli's macro.


    3.: Now take the special case of three buffers are open. Then, as per the manual, you have the option of entering the buffer number into the selection dialog box.

    If you have many differences between the two files being compared then this strategy may not be the optimal one. The reason being that at each step you have to enter
    the buffer number.

    4.: Many times a better strategy is to use Pauli's macro. That is to say, close the buffer not needed in the comparison. This reduces the case of three buffers to the case of two buffers
    , where no user input is needed.

    5.: Note that there are many excellent third party comparison programs. However, for these programs you have to enter the names of the two files that you wish to compare. So if you are a poor typist like myself, then this is a typo prone procedure.


    -peter
    Hello,

    Here is a solution for the special case of, say, the input file is open in Buffer-1 and the Buffers-2 and the Buffer-7 are open. Suppose that I wish to compare Buffers-1 and Buffers-2. Suppose further that the cursor position in each of these files is at the beginning of the buffers. Then I launch the Compare(2+BUFFER) command. The result is that Vedit moves the cursor position in each of these two buffers to he first place where they do differ.

    Actually, I have configured the Ctrl-N key to launch this command by by typing

    Key_Add("Ctrl-N",'[VISUAL EXIT] Compare2+BUFFER')

    into the Vedit Command window..


    I continue the comparison by clicking on the Ctrl-N key, until I reach the end of either of Buff-1 or Buffer-2.

    My next task is to translate the previous pseudo code into a macro.

    -peter
    Last edited by rejto12; September 4th, 2017 at 09:07 AM. Reason: typo

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts