Print Page | Close Window

Fancy statistics

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=8132
Printed Date: 06 April 2026 at 9:13pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Fancy statistics
Posted By: k00k
Subject: Fancy statistics
Date Posted: 16 December 2003 at 9:11am
Has anyone written an WWF mod which displays mad statistics such as number of words etc.?



Replies:
Posted By: michael
Date Posted: 16 December 2003 at 10:41am

If you want to assume that all words are seperated by a space you can use a function like


 Function fCountWords(strIn As String) As Integer
     Dim varWords As Variant

     If InStr(strIn, " ") > 0 Then
        varWords = Split(strIn, " ")
        fCountWords = UBound(varWords) - LBound(varWords) + 1
     Else
        fCountWords = 1
     End If

End Function

in your database (use it in db and not in asp so you don't have to pull all records down)
If you want to be sure to catch double spaces etc. (still not 100% because of Forum Codes a VBA function like

Function WordCount(str As String) As Long

Dim c As String  ' Character to examine
Dim i As Long  ' index into string
Dim nw As Long  ' number of words counted
Dim inword As Boolean ' indicates c is in a word or outside a word

i = 1
Do While i <= Len(str)
c = mid$(str, i, 1)
If (c = Chr$(32) OR c = Chr$(9)) Then
' c is a "white character" (a non-word character)
' Add other characters if you like:  NL chr(10), CR chr(13), etc.
  inword = False
ElseIf Not inword then
  inword = True
  nw = nw + 1
End If
i = i + 1
Loop

WordCount = nw

End Function

may work for you.

Well I don't know why you need that and it sure will cause a lot of overhead depending on the size of your forum but you can use both as a vba function and return the value to an asp page.



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net