Writing to Output Window (and others questions)

Writing to Output Window (and others questions)

8
NewbieNewbie
8

    Mar 07, 2007#1

    Hello

    I didn't found any Script Forum, so I hope Macro is close enough :)
    I am currently playing with the new script engine, and I have several questions you may have already answered.

    :arrow: Is there a way to write in the Output Window ?
    it could be very useful to debug scripts.

    :arrow: Is it possible to disable the Output Window for a script.
    I am using a TODO macro (with FindInFiles) and if I use a script, I lose all my todos just to know my 'Script succeeded'...

    :arrow: Is there a command to stop the execution of a script, like a 'stop' or 'exit' keyword ?

    :arrow: The doc say the script engine implements JavaScript 1.7, but it seems I can't use some 1.7 features, like 'yield'.
    Here is the example from Mozilla Dev Center :

    Code: Select all

    function fib() {
      var i = 0, j = 1;
      while (true) {
        yield i;
        var t = i;
        i = j;
        j += t;
      }
    }
    
    var g = fib();
    for (var i = 0; i < 10; i++) {
      document.write(g.next() + "<BR>\n");
    }
    
    Thanks for your help!

    344
    MasterMaster
    344

      Mar 08, 2007#2

      At least I can tell you how to stop a function:

      Code: Select all

      return;
      The rest: No clue, sry. Still trying hard on that Javascript....

      Bego
      Normally using all newest english version incl. each hotfix. Win 10 64 bit

      8
      NewbieNewbie
      8

        Mar 08, 2007#3

        Thanks, Bego, at least one out of 4 :wink:
        It seems to only work in functions though, but I can live with that :)

        1
        NewbieNewbie
        1

          Mar 10, 2007#4

          I think key would be the phrase "core functionality"

          I used the yield 1.7 sample from the same page and it errors out at that line.

          btw, after the upgrade I shot over here and was wondering if they had created a "Scripting forum" or put it under Macros.

          16
          Basic UserBasic User
          16

            Mar 13, 2007#5

            Is there a way to write in the Output Window ?

            I was wondering about that too. So far my best option is using the getValue as an alert box. But that isn't the prettiest solution.

            Paladin
            Paladin

              Mar 15, 2007#6

              For the interim you can always open one more document than you need (blank) and send your output there; i.e. if you have 2 documents that you're editing open a third and use:

              UltraEdit.document[2].write(my_variable);

              Yes, it's not pretty, yes you'd have to change the index (or "variablize" it), but it gets the job done for now.