Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


March 13, 2006

Sorting Arrays in VBScript

Implementing the Penton.VBSort object
RSS
View this exclusive article with VIP access -- click here to join |
See More Jscript Articles Here | Reprints | Or sign up for our VIP Monthly Pass!

Sorting an array is a common scripting task. The task is so common, in fact, that JScript (Microsoft's version of JavaScript) includes a sort method that sorts an array. VBScript, however, lacks the native capability to sort an array. I've written a Windows script component, VBSort.wsc, to address this limitation. Listing 1 shows VBSort.wsc. The Penton.VBSort object, implemented in the VBSort.wsc file, provides a set of three properties and a method that lets you quickly sort an array in VBScript.

Registering the Component
As with all script components, you must register VBSort.wsc on your computer before you use it in your scripts. To perform the registration, right-click VBSort .wsc in Windows Explorer and choose Register. (Conversely, to unregister the component, right-click VBSort.wsc and choose Unregister.) To register the component from a command prompt, use the following command:

regsvr32 /i:"path\VBSort.wsc"
  %SystemRoot%\system32  scrobj.dll 

where path is the directory in which theVBSort.wsc file resides. . . .


Already a VIP member?
Please log on to view the full article

Why become a VIP member?

VIP-only online access
VIP CD delivered twice a year: offline access to the entire Windows IT Pro article library
Monthly issue of your choice of Windows IT Pro or SQL Server Magazine

Subscribe Now
Top Viewed ArticlesView all articles
Anti-Virus Vendors Prepare for War with Microsoft ... Again

When Microsoft announced its Windows Live OneCare security and PC health product over five years (as MSN OneCare), Symantec, McAfee, and the other consumer-oriented security vendors reacted with stunning vigor. ...

What You Need to Know About Microsoft's x64 Server Product Plans

What do Longhorn Server, Windows Compute Cluster Server, and Windows Vista have in common? The x64 platform. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...


Task Automation Whitepapers Business Innovation with Data Center Transformation

Batch Job Scheduling and .NET in 2008

Continuous Data Protection and Recovery for Microsoft Exchange

Related Events 7 Ways To Get More From Your SharePoint Deployment Now

Check out our list of Free Email Newsletters!

Task Automation eBooks Spam Fighting and Email Security for the 21st Century

A Guide to Windows Certification and Public Keys

Keeping Your Business Safe from Attack: Patch Management

Related Task Automation Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound ITTV
IT Library Technology Resource Directory Connected Home asp.netPRO Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement | Reprints and Licensing