Search and Replace Maco asking for Input Parameter

Home Forums Multi-Edit User Created Macros Search and Replace Maco asking for Input Parameter

This topic contains 5 replies, has 147 voices, and was last updated by  Clay Martin 4 years, 11 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3006

    JRushmeyer
    Participant

    I am on the trial version of ME and I am trying to create a Macro that will need an input. I used the sample macro below

    VOID STEP_1()
    {
    Ignore_Case= True;
    while ( Search_Fwd("{<voter id=\"}", 0) ) Replace( ” );
    }

    I played with this one below

    VOID REP_TEST()
    {
    Ignore_Case= True;
    while ( Search_Fwd("{vote}", 0)) Replace( mparm_str);
    }

    but it doesnt ask (or accept) any parameters. (It runs but replaces with a blank space) I scanned the Users Manual (which is where I pulled the mparam_st from) but havent struck gold yet. I used to use ME when I worked for the State of Ohio but never did much with macros. I was also confused about where to enter the macro once it works. The manual talks about entering REP_TEST("myreplacement") but not sure how and where. Do I do it while I am in the file that needs massaging by using the Command Line drop down…or what? I know this sounds a little "first grade" like but hope it is clear.

    PS – If this works, "the check will ne in the mail to MultiEdit!!!"

    John Rushmeyer

    #9714

    Clay Martin
    Keymaster

    Hi,
    Just saw your post. I’m out of the office so I will have get back to you (and your other post) on monday.

    Thanks,
    Clay

    #9715

    Clay Martin
    Keymaster

    Hi,
    This might help you find out how to get input into a CMac macro:
    http://wiki.multiedit.com/doku.php/doc/ … /cmac_12.1
    Thanks,
    Clay

    #9716

    JRushmeyer
    Participant

    OK, Clay. Thanks. I am printing it out as I type. Will let you know what I come up with.

    John

    #9717

    JRushmeyer
    Participant

    Ok, Clay. Got it. Used the Int_Dlg code and the While…Replace maco and it worked. Here is code

    ==============================================
    #include dialog.sh

    void Big_Test()
    {
    int Dlg, Result;
    str MyText[259];

    DlgCreate( Dlg );

    DlgAddCtrl( Dlg, Dlg_Text, MyText,
    1, 1, //coordinates X, Y
    23, 1, //Width, Height
    1002, 0, "/ML=259" ); //ML=Max Length

    DlgSetStr( Dlg, 1002, "User enters text here." );

    Result = DlgExecute( Dlg, 1002, "Text",
    "",
    "",
    0 );

    MyText = DlgGetStr( dlg, 1002);

    MAKE_MESSAGE("MyText="+MyText);

    DlgKill( Dlg );

    Ignore_Case= True;
    while ( Search_Fwd("{vote}", 0)) Replace( MyText);
    }

    ================================================

    John
    PS – I also started printing out the CMAC Users Guide…I need something to read in the bathroom!!!!

    Thanks again. You have sold me on MultiEdit.

    #9721

    Clay Martin
    Keymaster

    Hi John,
    Glad to hear you got it going.
    Clay

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

You must be logged in to reply to this topic.