This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pass variable to Macro from toolbar

I have far too many little macros in separate files and run by toolbar buttons.   I would like to add them all to one macro file and pass a variable in choosing the appropriate macro function to run.   Below is what I would like to do but PHP flavored. How can I produce this desired effect in Extra basic?

Passed in like: url.php?picMacro=2

<?php
$picMacro =  $_GET['name'];
switch ($.picMacro) {
  case "1":
    macroFunction1();
    break;
  case "2":
    macroFunction2();
    break;
  case "3":
    macroFunction3();
    break;
  default:
   someFunction();
}
?>

Labels:

Mainframe Access
Parents
  • 0  

    Hi David,

    I will do some research, but I don't think it is possible to pass a command line parameter to an Extra Basic macro.

    Regards,

    Jeff B.

  • Suggested Answer

    0   in reply to   

    Hi David,

    It could be possible to create an application that may accept command line style parameters that the application could then parse and call the master Extra! Basic Macro, but that would be completely outside of the product.  The ebm macros are designed to be called and perform a specific function.  This functionality is not possible in the macro engine at this time. 

    Regards,

    Jeff B.

  • 0 in reply to   

    Thank you for your assistance.  I’m not trying to pass from the command line, I’m trying to pass from and extra toolbar to the macro.  Sorry if I explained that poorly.  The image below is the dialog in extra to define toolbar buttons.  Or is that still considered calling from command line?  Thanks 

Reply
  • 0 in reply to   

    Thank you for your assistance.  I’m not trying to pass from the command line, I’m trying to pass from and extra toolbar to the macro.  Sorry if I explained that poorly.  The image below is the dialog in extra to define toolbar buttons.  Or is that still considered calling from command line?  Thanks 

Children
  • 0   in reply to 

    Hi David,

    The button action for Run Macro is not expecting anything but the name of an existing macro.  If you put anything else in the drop down box that is not the name of a macro, the button call will fail.  I was using the term "Command line parameter" loosely to represent passing a parameter along with the macro name.

    Regards,

    Jeff