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.

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