Newbie questions on debugging and positions of selections

Newbie questions on debugging and positions of selections

30
Basic UserBasic User
30

    Oct 28, 2007#1

    New to scripting with UE, I have two really simple (I hope) questions:


    1. Is there any way to debug scripts in UE?

    2. Is there any way to grab the line/column positions of the start and end of a selection?


    TIA!

    6,682583
    Grand MasterGrand Master
    6,682583

      Oct 28, 2007#2

      Look on my hopefully well commented functions at Replacement for macro command Find Select to select a block between or with two found strings which is an answer for your second question.

      And your first question is also answered by my code. You will see how I have added debug messages and which techniques are possible for debugging. Writing to output window lets the script run without user interactions, but with information where something not worked as expected. Using a message box has the advantage of pausing script execution and so you can see how the file currently looks like.

      I think, a real debug with step by step execution is not possible. But I'm a newbie in script writing too.
      Best regards from an UC/UE/UES for Windows user from Austria

      30
      Basic UserBasic User
      30

        Oct 28, 2007#3

        I'm sad to see that a true debugging is not possible - that would have been fantastic if it could be done.

        But that being the case, your code was indeed very helpful, in both respects. Thank you!  :)

        262
        MasterMaster
        262

          Oct 29, 2007#4

          Nope, step-by-step and break-point debugging is currently not possible in the UE scripting engine. You have to rely on techniques as implemented by Mofi in his scripts.

          From the start with JavaScript in web browsers the situation was much the same. A lot of document.write("<!-- my trace output -->") and alert() was used to debug. But in recent years more and more powerful tools are available to JavaScript developers in both IE and Firefox. The Venkman JavaScript Debugger for Firefox is the most capable debugger I have come across. Maybe there are others even more capable that I just isn't aware of.

          Sadly I can't see how this can integrate with the scripting engine in UE. But if the UE users continue to develop more and more complex scripting solutions, we might want to ask IDM to consider supplying an add-on debugging tool for UE, or some kind of integration with existing tools.

          But for now, use Mofi's approach and also clean your JavaScript code for the most obvious errors with JavaScript Lint which is embedded in UltraEdit for Windows since version 26.00 and in UEStudio already since v09.00 and can be run without configuring first a user tool.

          30
          Basic UserBasic User
          30

            Oct 29, 2007#5

            Out of curiosity, would UEStudio's integrated debugger allow for this functionality? Or would even that not work with their scripting engine?