AlexKaras's avatar
AlexKaras
Champion Level 3
7 years ago
Status:
New Idea

'Run Current Routine' Code Editor's context menu command to be enabled for procedures and functions

As all supported scripting languages (except VBScript) support optional function parameters that can be set within the function body, I think that it is a good idea to make the 'Run Current Routine' Code Editor's context menu command to be enabled for both procedures and functions for all scripting languages except VBScript (where it should be left disabled for functions as it is now).

2 Comments

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Or, perhaps an even better solution than using "default values"... what if the "Run Current Routine" option, if it detects that the function/procedure has parameters, prompt to fill them in?

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Robert,

     

    May be, though I am not sure. This will definitely work for simple data types like string or integer, but most probably will not work for, say, objects that might be set in code.

    Something like that:

    function ButtonFind(oRoot)

    {

      if ("undefined" == typeof(oRoot))

        oRoot = PageGetCurrent();

     

      ...

      var oButton = oRoot.FindChild(...);

      ...