Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
2.3 KiB

  1. '***************************************************************************
  2. 'This script tests the manipulation of qualifier values, in the case that the
  3. 'qualifier is an array type
  4. '***************************************************************************
  5. On Error Resume Next
  6. while true
  7. Set Service = GetObject("winmgmts:root/default")
  8. Set Class = Service.Get()
  9. Class.Path_.Class = "ARRAYQUAL00"
  10. Class.Qualifiers_.Add "q1", Array (1, 20, 3)
  11. str = "The initial value of q1 is [1,20,3]: {"
  12. for x=LBound(Class.Qualifiers_("q1")) to UBound(Class.Qualifiers_("q1"))
  13. str = str & Class.Qualifiers_("q1")(x)
  14. if x <> UBound(Class.Qualifiers_("q1")) Then
  15. str = str & ", "
  16. End if
  17. next
  18. str = str & "}"
  19. WScript.Echo str
  20. WScript.Echo ""
  21. 'Verify we can report the value of an element of the qualifier value
  22. v = Class.Qualifiers_("q1")
  23. WScript.Echo "By indirection the first element of q1 has value [1]:",v(0)
  24. 'Verify we can report the value directly
  25. WScript.Echo "By direct access the first element of q1 has value [1]:", Class.Qualifiers_("q1")(0)
  26. 'Verify we can set the value of a single qualifier value element
  27. Class.Qualifiers_("q1")(1) = 11
  28. WScript.Echo "After direct assignment the second element of q1 has value [11]:", Class.Qualifiers_("q1")(1)
  29. Set Qualifier = Class.Qualifiers_("q1")
  30. Qualifier.Value(2) = 37
  31. WScript.Echo "After direct assignment the third element of q1 has value [37]:", Class.Qualifiers_("q1")(2)
  32. 'Verify we can set the value of a single qualifier value element
  33. Set v = Class.Qualifiers_("q1")
  34. v(1) = 345
  35. WScript.Echo "After indirect assignment the first element of q1 has value [345]:", Class.Qualifiers_("q1")(1)
  36. 'Verify we can set the value of an entire qualifier value
  37. Class.Qualifiers_("q1") = Array (5, 34, 178871)
  38. WScript.Echo "After direct array assignment the second element of q1 has value [34]:", Class.Qualifiers_("q1")(1)
  39. str = "After direct assignment the entire value of q1 is [5,34,178871] {"
  40. for x=LBound(Class.Qualifiers_("q1")) to UBound(Class.Qualifiers_("q1"))
  41. str = str & Class.Qualifiers_("q1")(x)
  42. if x <> UBound(Class.Qualifiers_("q1")) Then
  43. str = str & ", "
  44. End if
  45. next
  46. str = str & "}"
  47. WScript.Echo str
  48. Class.Put_ ()
  49. if Err <> 0 Then
  50. WScript.Echo Err.Description
  51. Err.Clear
  52. End if
  53. wend