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:/Python311/Lib/site-packages/win32com/test/testDictionary.vbs
' Test Pyhon.Dictionary using VBScript - this uses
' IDispatchEx, so is an interesting test.

set ob = CreateObject("Python.Dictionary")
ob("hello") = "there"
' Our keys are case insensitive.
ob.Item("hi") = ob("HELLO")

dim ok
ok = true

if ob("hello") <> "there" then
    WScript.Echo "**** The dictionary value was wrong!!"
    ok = false
end if

if ob("hi") <> "there" then
        WScript.Echo "**** The other dictionary value was wrong!!"
        ok = false
end if

if ok then
    WScript.Echo "VBScript has successfully tested Python.Dictionary"
end if