A Real-World Example
"WSH, Part 2: .wsf Files" presents a WSF script that reports the members of a group. To continue this theme, I decided to present a script component that provides the same functionality. The Penton.GetMembers component provides two write-only properties, GroupName and Domain-Name, and one method, Members. The Members method returns a sorted array containing the members of the group. Listing 2 shows the VBScript implementation of the GroupName and DomainName properties and the Members method. Listing 2 is only an excerpt from the Penton.GetMembers component. You can download the entire component from the Windows Scripting Solutions Web site. Go to http://www.windowsitpro.com/windowsscripting, enter 49092 in the InstantDoc ID text box, then click the 49092.zip hotlink.
At callout A in Listing 2, note how the Members method calls the SortVBArray JScript function, which I created earlier in the component. This function returns a sorted copy of the specified VB safe array. (A safe array, also known as a VB array, is the array type used by VBScript.) . . .