APGen Documentation Previous Topic: ASPCache.Exists() Next Topic: ASPCache.HandleOf() Parent Topic: ASPCache Object    ASPCache Object
ASPCache.KeyOf()
See Also:

Returns the string key corresponding to this handle.

Syntax

VBScript:

sKey = Cache.KeyOf( h )

JScript:

sKey = Cache.KeyOf( h );

Object

Cache An ASPCache object.

Parameters

h A handle to an item in the cache.

Return Value

sKey The string key for the item.

Notes

KeyOf is the inverse of HandleOf.

This example displays all the items in the cache:

<% @LANGUAGE="VBScript" %>
<% Option Explicit %>
<%
'-------------------------------------------------------------------
'     display.asp
'
'     WebGecko Software, Copyright(c) 2000
'     Author: johnc
'
'     Description: Display contents of the ASPCache
'-------------------------------------------------------------------

%>
<HTML><HEAD>
     <META http-equiv="refresh" content="2" >
</HEAD><BODY>
<H2>Displaying contents of ASPCache:</H2>
<P>There are
<% =Cache.Count %> items in the ASPCache.</P>
<P>Start time:
<% =Now %></P>

<table>
<tr><th>Key</th><th>Value</th></tr>
<%
Dim h
For Each h in Cache     %>
     <tr><td>
<% =Cache.KeyOf(h) %></td><td><% =Cache(h) %></td></tr>     <%
Next
%>
</table>
<P>End time:
<% =Now %></P>
</BODY></HTML>