Custom multi-line search macro needed

Home Forums Multi-Edit User Created Macros Custom multi-line search macro needed

This topic contains 4 replies, has 2 voices, and was last updated by  Clay Martin 3 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21828

    CharlesG
    Participant

    I would like to use block marking (column, stream, or line) to use for a custom search macro – but not sure of how to do it please. Using mew 2008.

    I guess the macro would need to take into account if the marked text had any special MEW charachters –

    #21835

    Clay Martin
    Keymaster

    If you want to mark a block, then search within the block you can use the “restrict to marked block” option on the search dialog.

    HTH,
    Clay

    #21836

    CharlesG
    Participant

    I want to mark mark multiple lines then see if the marked lines appear elsewhere in the file.

    I am aware of the “restrict to marked block” opton but that is not what I want.

    #21837

    CharlesG
    Participant

    P.S. Once I have marked the lines – then I would like to have search_str be the result of

    search_str = “”
    save current positoon
    goto first line marked
    for each line marked
    remark : make sure to handle getline below
    correctly in case any special MEW
    cars appear
    search_str = search_str + “%” + getline() + “$”
    down;
    endfor
    search for any more occurances of search_str from currnet pos to EOF
    goto saved position

    #21838

    Clay Martin
    Keymaster

    Well, you would need two nested loops one for stepping thru the multiple marked lines (to be searched for) and one for the multiple searches (unless search all is used) till EOF. What do you want to do with the found lines? The Make_Literal (or Make_Literal_X for unix regexp search) function can take care of regexp chars in the line being searched for.

    HTH,
    Clay

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.