<HTML>
<title>Smart Counter Example</title>
<PRE>
This counter saves counter files in the Smart.Cdir folder.
Add a counter by typing:
<<$mycounter>>
on any page. The tag assigns values to the names myhits (number
of hits on the page) and cfile (name of counter file).
The counter files in the Smart.Cdir directory have the names of
the pages on which counters are placed, one counter file per page.
Read these files to see total page hits. Or create a simple
HTML page to display the counter file values on the screen.
<<
Smart.MyCounter = '
Smart.CDir="/archive"
Smart.CFile = REPLACE(PAGE,DIRNAME(PAGE),"")
Smart.CFile = REPLACE(Smart.CFile,".html",".txt")
Smart.CFile = REPLACE(Smart.CFile,".htm",".txt")
Smart.CFile = Smart.CDir + "/" + Smart.CFile
COPY FILE=Smart.CFile TO Smart.MyHits /COPY
IF Smart.MyHits = "ERROR" THEN
Smart.MyHits = 1
ELSE
Smart.MyHits = Smart.MyHits + 1
/IF
COPY Smart.MyHits TO FILE=Smart.CFile /COPY '
>>
<!-- Increment the counter -->
<<$Smart.MyCounter>>
<br><br>
<center>
Sample Page
<!-- Use Tags below to display values -->
<br><br>
Counter File Name: <b><<Smart.CFile>></b><br>
Hits in Counter: <b><<Smart.MYhits>></b><br><br>
<a href=<<PAGE>>>Hit This Page Again</a>
</center>
</body>
</html>