MOTOBIT.COM - ASP upload, IIS utility Using Dictionary class Article

Member of  Multi | Changes | Purchase | Download

Using Dictionary class

How to use Dictionary class in VBA (VB5, VB6, Word, Excel, VBNet, ), VBS / JS (ASP, WSH).

1. VBA (VB5, 6, Net, Word, Excel, Access, ..)

      Go to Project->References and select "ASP/VBS multidictionary class". Then you can browse library classes, properties, methods and enums (click F2). MultiDictionary has a context-sensitive help.
      You can create dictionary object using New command:
Dim D as Multi.Dictionary
Set D = New Multi.Dictionary
'or 
Dim D1 As New Multi.Dictionary
D.Add Key, Value
D1(Key) = Value
'.

2. VBS

      Use CreateObject function
Dim D
Set D = CreateObject("Multi.Dictionary")

3. ASP

      You can use CreateObject function (better than Server.CreateObject method in VBS). You can define object live/existence with CreateObject function - using Var = Empty or Set Var = Nothing.
      You can also use <object ProgID=Multi.Dictionary ...> tag to create Dictionary. MultiDictionary is both-threaded object, so you can use it on any ASP scope - Application, Session or Page. You can place it to Global.asa to share Dictionary by each ASP page in the application:
<OBJECT RUNAT=server SCOPE=Application
 PROGID=Multi.Dictionary ID=MyDict></OBJECT>

Or on page (Same as Server.CreateObject):
<OBJECT RUNAT=server 
 PROGID=Multi.Dictionary ID=MyDict></OBJECT>

4. JScript / Javascript

You can use <Object> tag or new operator ("new ActiveXObject"):
<Script RunAt=Server Language=JScript>
var d 
d = new ActiveXObject("Multi.Dictionary")
d.Add("Key", "Value") //or var d1 = new ActiveXObject("Multi.Dictionary") </Script>a

Other links for Using Dictionary class article

Multi

Free-threaded (multithreaded) dictionary object. Lets you work with unique/non-unique keys in VBScript and JScript envinronment (share application/session variables in ASP) or any other programming language. You can share dictionary variables between processes or computers, you can save or restore dictionary variables to a disk, work with keys using regular expression and more.

© 1996 - 2009 Antonin Foller, Motobit Software | About, Contacts | e-mail: info@pstruh.cz


Other Motobit links:   IISTracer, real-time IIS monitor   ASP file upload - upload files to ASP. 
ActiveX/VBSScript registry editor  ActiveX NT User account manager  Export MDB/DBF from ASP Active LogFile  Email export  ActiveX/ASP Scripting Dictionary object