Name
Increment —
objCounter
.Increment(
strCounterName
)
Synopsis
Increments a counter in the Counters component. If you attempt to increment a counter that does not yet exist, the counter is created and its value is set to 1. The new value of the counter is returned.
Parameters
-
strCounterName
A string that represents the name of the counter variable you wish to manipulate. This name can contain any Unicode character.
Example
The following example assumes a Counters object
(gobjOptionCounter
) has been instantiated
elsewhere (see Section 18.2 earlier in this
chapter) and demonstrates the use of the Increment method.
<HTML>
<HEAD>
<TITLE>Favorite Games</TITLE>
<BODY>
<%
' The following line of code increments the
' FavGameCounter_Doom counter in the gobjOptionCounter
' object and returns the new value of the counter.
' Note that if FavGameCounter_Doom does not yet exist
' in the gobjOptionCounter object, the returned value
' is 1.
%>
You are user number
<%= gobjOptionCounter.Increment("FavGameCounter_Doom") %>
to vote for Doom as your favorite game.<BR>
%>
. . . [additional HTML and code]
Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.