Tapatalk

Shortcut to UltraEdit.outputWindow.write

Shortcut to UltraEdit.outputWindow.write

8

    Oct 28, 2010#1

    Since it's only used for debugging (or, at least for info to current UE user), I'd like to see a scriptable shortcut to UltraEdit.outputWindow.write.

    And since it's a shortcut and meant for programmers, I propose this: ? (Yes, I'm a VBer)

    In your code you just write:
    ? "this is the value of x now:" + x;

    And, if the Output Window were used as an Immediate Window in the future it would still work and save space.

    ALSO, why not, again since it's for debugging, make the syntax match the sprintf() function
    ? "this is our co-ordinates [%d,%d] and the next ones [%d,%d]\n", x,y,x2,y2;


    ALSO, make sprintf part of the language. or, adopt String.Format() from .Net for the above, too (but that's not Javascript)

    901
    MasterMaster
    901

      Oct 28, 2010#2

      First of all, as specified at the top of every page, this is a user-to-user forum which is not monitored by IDM. All suggestions and feature requests should be emailed directly to IDM. Regarding your suggestion to adopt the String.Format() from .Net, keep in mind that although the IDM development team does use Visual Studio 2008 as their IDE, UltraEdit is written in old-school C++ (API calls without leveraging the Microsoft Foundation Class wizards or the .NET framework available in Visual Studio). The goal is to retain the performance advantages of C++ (avoiding the overhead of calling the common runtime libraries) and to maintain compatibility with older Windows operating systems.

      262
      MasterMaster
      262

        Oct 29, 2010#3

        It is not only used for debugging. I use the output window for informational data about programs or datasets.

        I frequently create shortcuts for the output window like:

        Code: Select all

        function log (logmsg) { UltraEdit.outputWindow.write(logmsg); }
        ...
        log("this is the value of x now:" + x);
        The string formatting part is really more a language issue, than an UltraEdit API issue. I agree javascript could use a face lift of its string object functions.

        But why not find a decent sprintf javascript function released to the public domain like http://www.diveintojavascript.com/proje ... pt-sprintf and save it as a file in your UltraEdit script folder.

        It is not as convenient as what you describe but you will still able to write

        Code: Select all

        // include <path to your ultraedit script files>/function-sprintf.js
        function log (logmsg) { UltraEdit.outputWindow.write(logmsg); }
        ...
        log( sprintf("this is our co-ordinates [%d,%d] and the next ones [%d,%d]", x,y,x2,y2) );
        But as bulgrien advices please feel free to send your feature request to IDM - you never know.