环境设置
安装VisualStudio ,VS2003~VS2022
设置编绎选项
CScript.exe /d 调试开关
写一堆测试代码:
// JavaScript source code
var d = new ActiveXObject("Scripting.Dictionary");
Init();
JSTest();
JSTest2();
debugger;
var a = d.Items().toArray();
var name =a[0] ;
name = d.Item("001");
print(name);
Exit();
function print(x) {
WScript.Echo(x);
}
function Init() {
d.Add("001", "牛牛");
d.Add("002", "妙妙");
print("Start...");
}
function JSTest() {
var b = new VBArray(d.Items()).toArray();
for (var i = 0; i <d.Count ; ++i) {
print("编号" + b[i]);
}
}
function Exit() {
print("exit........");
}
function JSTest2() {
for (var key in d) {
var item = d[key];
print(item);
}
}