script1.jvs

来自「在程序中加入脚本支持」· JVS 代码 · 共 42 行

JVS
42
字号
/////////////////////////////////////////////////////////////
//
// script1.jvs - Don Box, 1996-1997
// 
// A JavaScript program
//

// handler that will execute when games are played by "shell"
function shell_OnPlayGame(s) {
  shell.writeLn("playing " + s);
}

// function that starts three instances of notepad and one instance of freecell
function Foo() {
    for (i = 0; i < 3; i++) {
        shell.exec("notepad.exe")
    }
    shell.exec("freecell.exe")
}

// function that writes some text to the console
function Bar(x, y) {
    shell.write(x)
    shell.write(", ")
    shell.writeLn(y)
    shell.writeLn("JavaScript Rocks!")
    while (y--) {
        shell.writeLn("I love COM")
	}
    shell.writeLn("Every app should be scriptable!")
}

// main entry point that uses the shell object
function main() {
    shell.alert("The X is now silent AND invisible!")
    Bar(10, 20)
    Foo()
}



  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?