Search notes:

.scriptrun

hello-world.js

"use strict"

var g_text;

function initializeScript() {
  //
  // initializeScript() is executed with both
  // .scriptrun and .scriptload
  //
     g_text = "Hello world.\n";

}

function invokeScript() {
  //
  // invokeScript() is like main() in C: it is invoked
  // when .scriptrun is used to execute a script
  //

     host.diagnostics.debugLog(g_text);
}

Loading and executing hello-world.js

0:003> .scriptrun C:/Users/Rene/hello-world.js
JavaScript script successfully loaded from 'C:\Users\Rene\hello-world.js
Hello world.
0:003> dx Debugger.State.Scripts
Debugger.State.Scripts
    hello-world

Index