home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_2739 < prev    next >
Encoding:
Text File  |  2003-11-10  |  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.