Save

ActiveX/VBSScript registry editor  ActiveX NT User account manager  Export MDB/DBF from ASP
Url replacer, IIS url rewrite Active LogFile  Email export  ActiveX/ASP Scripting Dictionary object
 IISTracer, real-time IIS monitor
 Huge ASP upload - upload files with progress.
          Method 
          Member of  Multi.Dictionary 

Description

Save all dictionary data to a file.

Syntax

Dictionary.Save (FileName as String, [SaveEmpty as Boolean = False], [Pattern as String = Empty])
 
Where Type Optional Default Description
 FileName  String     Name of the file to store dictionary values 
 SaveEmpty  Boolean  yes  False  Save also empty and unknown values 
 Pattern  String  yes  Empty  A Regular Expression string search pattern for selecting keys to save to a file. 

Remarks

This method saves only string and numeric values of the dictionary members. Other values (arrays, objects ..) are stored only as a string, if it is possible to convert them to a string. Next table shows all variant types which can be stored to the file.
OLE typeVBA type
VT_EMPTY Empty
VT_NULL Null
VT_UNKNOWN -
VT_VOID -
VT_I2 Integer
VT_UI2 -
VT_BOOL Boolean
VT_R4 -
VT_I4 Long
VT_UI4 -
VT_INT -
VT_UINT -
VT_HRESULT -
VT_ERROR -
VT_I8 -
VT_UI8 -
VT_R8 -
VT_CY Currency
VT_DATE Date
VT_I1 -
VT_UI1 Byte
VT_BSTR String

Examples

 Store all dictionary data to a file  
Set o = CreateObject("multi.Dictionary")


'Add some data to the dictionary
o.Add "vbNullString", vbNullString
o.Add "dbl", CDbl(10)
o.Add "sng", CSng(15)
o.Add "array", Array(1)
o.Add "currency", CCur(11)
o.Add "byte", CByte(12)
o.Add "int", CInt(13)
o.Add "lng", CLng(14)
o.Add "string", "Some text"
o.Add "bool", True

o.Add "empty", empty
o.Add "null", null


'Save the dictionary to a file
o.Save "F:\aa.dic", False

'remove all data from the dictionary
o.RemoveAll

'Load the data to the dictionary.from the file
o.Load "F:\aa.dic"

See also

  Other links for Save

Methods of Dictionary class

Properties of Dictionary class

Multi.Dictionary

Free threaded dictionary object. Lets you work with unique/non-unique keys, any VARIANT values and connect to other dictionary in the same process.
     Dictionary is a COM class specially designed as a free-threaded dictionary in Application scope of ASP/ASP.Net pages. It also works with script other engines in VB Script and JScript (ASP,ASP.Net, WSH, CHM, HTA), VB Net, Visual basic (VBA - VB 5, VB 6, Word, Excel, Access, …), C#, J#, C++, ASP, ASP.Net, Delphi and with T-SQL OLE functions - see Use ByteArray object article. You can also use the object in other programming environments with COM support, such is PowerBuilder.
     Source code for Dictionary is available within distribution license, please see License page for Multi Dictionary or License page for ASP file upload and ScriptUtilities.

Multi

Multithreaded dictionary object. Lets you work with unique/non-unique keys in VBA/VBS/ASP/WHS envinronment (share application/session variables in ASP)

© 1996 – 2008 Antonin Foller, Motobit Software, help{at}pstruh.cz, help v. 1.1.2.3