|   | Product Home Page | Developer Site | Version | 
|      | 
Display the value of a counter with:
<%= Counters.Get(CounterName) %>
Assign the value of the counter to a variable with:
<% countervar = Counters.Get(CounterName) %>
The following script displays the vote tally from a poll about favorite colors.
<%
If colornumber = "1" Then
  Counters.Increment("greencounter") 
Else
If colornumber = "2" Then
   Counters.Increment("bluecounter") 
Else
If colornumber = "0" Then
    Counters.Increment("redcounter") 
End If
End If
End If
%>
<P>Current vote tally:
<P>red: <% = Counters.Get("redcounter") %>
<P>green: <% = Counters.Get("greencounter") %> 
<P>blue: <% = Counters.Get("bluecounter") %>
    
|      | 
Copyright © 2003 Sun Microsystems, Inc. All rights reserved.