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.

52 lines
1.0 KiB

  1. '
  2. ' test1.vbs
  3. '
  4. ' test string manipulation
  5. '
  6. Dim a(2,4)
  7. Dim DevConStrings
  8. Dim String
  9. Dim b
  10. a(1,1) = "1,1"
  11. a(1,2) = "1,2"
  12. a(1,3) = "1,3"
  13. a(1,4) = "1,4"
  14. a(2,1) = "2,1"
  15. a(2,2) = "2,2"
  16. a(2,3) = "2,3"
  17. a(2,4) = "2,4"
  18. set WshShell = WScript.CreateObject("WScript.Shell")
  19. set DevConStrings = WScript.CreateObject("DevCon.Strings")
  20. DevConStrings.Add "Alpha"
  21. DevConStrings.Add "Beta"
  22. DevConStrings.Add "Gamma"
  23. DevConStrings.Add "Delta"
  24. DevConStrings.Insert 2,a
  25. Wscript.Echo "Everything with a(xx) at 2"
  26. Count = DevConStrings.Count
  27. Wscript.Echo "Count="+CStr(Count)
  28. FOR EACH String In DevConStrings
  29. WScript.Echo String
  30. NEXT
  31. Wscript.Echo "As array"
  32. b = DevConStrings
  33. set DevConStrings = nothing
  34. set DevConStrings = WScript.CreateObject("DevCon.Strings")
  35. DevConStrings.Add b
  36. Wscript.Echo ""
  37. Wscript.Echo "As array re-applied"
  38. FOR i = 1 TO Count
  39. WScript.Echo DevConStrings(i)
  40. NEXT
  41. Wscript.Echo ""
  42. Wscript.Echo "As array raw"
  43. FOR i = 1 TO Count
  44. WScript.Echo b(i)
  45. NEXT