Caprock Vector

A thread-safe vector component for use in the Session and Application. I did not write this component. The original author has evaporated, so I have archived it for the betterment of mankind.

The Vector Object is a COM component designed to work with any scripting environment (it also supports native interfaces within Visual Basic and Visual C++). Whether you are using IIS/ASP or you are using the Windows Script Hosting environment, you can use this object to store items in a grow-able array or vector. The items can be any automation compatible data type such as strings, numbers and other automation objects. This object is designed to be a dynamic, growable array or collection. It supports traditional item references by numeric index such as:

for index = 0 to 10
   response.write vec.Item(index)

but also item reference by textual index like so:

set foo = vec.Item(“Foo”)

The unique quality about textual or Named items, they are only supported by automation objects that implement the “Name” property. In other words, you can store an automation object in the Vector. The Vector inspects the automation object for a property called “Name”. If the Vector finds this property, it will allow you to reference the item in the Vector by name or numerical index.

Special consideration has been made for the Vector object to work with IIS/ASP’s intrinsic Application and Session objects. You can store a reference to a Vector object in one or both of these objects without affecting the performance of your web application. This is accomplished by marking the Vector COM component as both apartment and free-threaded, aggregating the Free-Threaded Marshaler. This component was developed with VC++ 6.0 and ATL 3.0 for the best performance possible.

Attached File Download the 76k zip file containing the DLL, source code, samples and documentation.

Comments are closed.