Number 2 in a very occasional series
Something which I discovered quite by accident is that you can access lots of .Net functionality from VBScript.
For example, anyone who's progressed beyond the "Hello World" type script will know what a pain it is dealing with arrays. Leaving aside the response "So use dictionaries instead", how about using .Net's ArrayList methods? To wit:
For example, anyone who's progressed beyond the "Hello World" type script will know what a pain it is dealing with arrays. Leaving aside the response "So use dictionaries instead", how about using .Net's ArrayList methods? To wit:
Option Explicit
Dim objDataList
Dim strItem
Set objDataList = CreateObject("System.Collections.ArrayList")
With objDataList
.Add "B"
.Add "C"
.Add "E"
.Add "D"
.Add "A"
.Sort()
End With
For Each strItem in objDataList
Wscript.Echo strItem
Next
WScript.Echo vbCRLF & "Now, remove element 'D' and we get:"
objDataList.Remove("D")
For Each strItem in objDataList
Wscript.Echo strItem
Next
0 Comments
[ + ] Show comments
Answers (0)
Please log in to answer
Be the first to answer this question
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.