home *** CD-ROM | disk | FTP | other *** search
/ PC World 2002 May / PCWorld_2002-05_cd.bin / Software / TemaCD / activepython / ActivePython-2.1.1.msi / Python21_win32com_test_testDictionary.vbs < prev    next >
Encoding:
Text File  |  2001-07-26  |  588 b   |  27 lines

  1. ' Test Pyhon.Dictionary using VBScript - this uses
  2. ' IDispatchEx, so is an interesting test.
  3.  
  4. set ob = CreateObject("Python.Dictionary")
  5. ob("hello") = "there"
  6. ' Our keys are case insensitive.
  7. ob.Item("hi") = ob("HELLO")
  8.  
  9. dim ok
  10. ok = true
  11.  
  12. if ob("hello") <> "there" then
  13.     WScript.Echo "**** The dictionary value was wrong!!"
  14.     ok = false
  15. end if
  16.  
  17. if ob("hi") <> "there" then
  18.         WScript.Echo "**** The other dictionary value was wrong!!"
  19.         ok = false
  20. end if
  21.  
  22. if ok then
  23.     WScript.Echo "VBScript has successfully tested Python.Dictionary"
  24. end if
  25.  
  26.  
  27.