/build/static/layout/Breadcrumb_cap_w.png
10/27/2009 2154 views
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: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

Comments


There are no answers at this time

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share