Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Fancy statistics
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Fancy statistics

 Post Reply Post Reply
Author
k00k View Drop Down
Newbie
Newbie


Joined: 18 November 2003
Location: United Kingdom
Status: Offline
Points: 29
Post Options Post Options   Thanks (0) Thanks(0)   Quote k00k Quote  Post ReplyReply Direct Link To This Post Topic: Fancy statistics
    Posted: 16 December 2003 at 9:11am
Has anyone written an WWF mod which displays mad statistics such as number of words etc.?
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.