Documentcache Object - MACROMEDIA COLDFUSION STUDIO 4.5-USING COLDFUSION STUDIO Use Manual

For windows 95/98/nt4/2000
Table of Contents

Advertisement

DocumentCache Object

It is very important to understand the DocumentCache object when using the Visual
Tools Object Model. Although the visual tools enable you to open dozens of files at
once, only the active document is kept in memory. When a document becomes
inactive, that is, when the user switches to a different document in the Document tab,
the previously active document is cached to conserve resources.
Every open document has an element in the
refer to a specific cached document, use
Index
The JScript example below shows how to loop through the array:
var app = Application;
for (idx = 0; idx < app.DocumentCount; idx++) {
Here's the same code in VBScript:
set app = Application
for idx = 0 to app.DocumentCount - 1
sFile = app.DocumentCache(idx).Filename
next
If you know the filename of an open document, you can retrieve its index by using the
Application.GetTabIndexForFile
var app = Application;
idx = app.GetTabIndexForFile('c:\docs\file.htm');
To access more information about a cached document, you must first make it the
active document and refer to it using the Application object's ActiveDocument
property. To do this, set the
cached document.
Properties
All properties of the DocumentCache object are read-only.
Filename (OleString)
Filename of the cached document.
Modified (WordBool)
True if the cached document has been modified since it was last saved.
ReadOnly (WordBool)
True if the cached document is read-only.
Text (OleString)
File contents of the cached document.
is the index of the document in the Document tab.
sFile = app.DocumentCache(idx).Filename;
}
bReadOnly = app.DocumentCache(idx).ReadOnly;
Application.DocumentCache
Application.DocumentCache(Index)
function, like this:
Application.DocumentIndex
array. To
property to the index of the
217
, where

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion studio 4.5

Table of Contents