HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/anaconda3/Lib/site-packages/win32com/test/testPyScriptlet.js
function print(msg)
{
  WScript.Echo(msg) ;
}

function check(condition, msg)
{
  if (!condition) {
    print("***** testPyScriptlet.js failed *****");
    print(msg);
  }
}

var thisScriptEngine = ScriptEngine() ;

var majorVersion = ScriptEngineMajorVersion() ;
var minorVersion = ScriptEngineMinorVersion() ;
var buildVersion = ScriptEngineBuildVersion() ;

WScript.Echo(thisScriptEngine + " Version " + majorVersion + "." + minorVersion + " Build " + buildVersion) ;

var scriptlet = new  ActiveXObject("TestPys.Scriptlet") ;

check(scriptlet.PyProp1=="PyScript Property1", "PyProp1 wasn't correct initial value");
scriptlet.PyProp1 = "New Value";
check(scriptlet.PyProp1=="New Value", "PyProp1 wasn't correct new value");

check(scriptlet.PyProp2=="PyScript Property2", "PyProp2 wasn't correct initial value");
scriptlet.PyProp2 = "Another New Value";
check(scriptlet.PyProp2=="Another New Value", "PyProp2 wasn't correct new value");

check(scriptlet.PyMethod1()=="PyMethod1 called", "Method1 wrong value");
check(scriptlet.PyMethod2()=="PyMethod2 called", "Method2 wrong value");