54 lines
1.7 KiB
Plaintext
54 lines
1.7 KiB
Plaintext
Module CheckJavaScript {
|
|
Clear
|
|
Module ok {
|
|
if match("S") then {
|
|
read m$
|
|
print "ok", m$
|
|
} else {
|
|
read m
|
|
print "ok", m
|
|
}
|
|
}
|
|
Declare vs "MSScriptControl.ScriptControl"
|
|
Declare Alfa Module
|
|
Print Type$(Alfa)
|
|
With vs, "Language","Jscript", "AllowUI", true
|
|
Method vs, "Reset"
|
|
Print Type$(Alfa)
|
|
Method vs, "AddObject", "M2000", Alfa
|
|
Inventory alfa1=1,2,3,4:="Ok"
|
|
If exist(alfa1,4) then print "Ok..."
|
|
Print type$(alfa1)
|
|
Method vs, "AddObject", "Inventory", alfa1
|
|
A=(1,2,3,4,"Hello")
|
|
Method vs, "AddObject", "Arr", A
|
|
Method vs, "ExecuteStatement", {
|
|
M2000.AddExecCode("Function BB {=1234 **number} : k=2");
|
|
M=M2000.ExecuteStatement("Print 1234, BB(k)");
|
|
// wait a key
|
|
M2000.AddExecCode("aa$=key$");
|
|
var m=[10,10+5,20];
|
|
M2000.CallModule("ok" , Inventory.count) ;
|
|
n=Inventory.Find("4");
|
|
Inventory.Value="Not Ok"
|
|
M2000.CallModule("ok" ,Inventory.Value) ;
|
|
M2000.CallModule("ok" ,Arr.Count)
|
|
Arr.item(4)="George"
|
|
Arr.item(1)++;
|
|
M2000.CallModule("ok" ,Arr.item(4))
|
|
}
|
|
Print Alfa1$(4) '' Not Ok.
|
|
Print Array$(A, 1) ' 3
|
|
Print Array$(A, 4) ' George
|
|
Modules ?
|
|
\\ BB() and K created from javascript
|
|
Print BB(k)
|
|
Method vs, "eval", {"hello there"} as X$
|
|
Print X$
|
|
Method vs, "eval", {"hello there too"} as X$
|
|
Print X$
|
|
List ' print all variables
|
|
Declare vs Nothing
|
|
}
|
|
CheckJavaScript
|