Box 24

 Home   Infos   Tipps   Webmail   Humor   Polizei   Gästebuch   Downloads   Chat   Suchen   Feedback   Links 

 

 Anmelden/Login   Neuanmeldung/New User   Java Telnet Applet   Telnet   
 

Top 10 message generator

// Top Ten message generator

Dim ConfNo as Integer = val(paramstr(1)) // conference to show
Dim TopMax as Integer = 10   // maximum amount to show

Type Tmsgstat
  count as integer
  msg as TMsgHeader
end type

Dim TopMsgs() as TMsgStat

Redim TopMsgs(TopMax)

LoginSystem()
  print "Generating top ";TopMax;" messages...."
  dim i as integer
  Dim Msg as TMsgHeader
  clear msg
  msg.conference = confNo

  do while GetNextMessage(msg)
   // find lowest
   dim low as integer = 1
   for i = 1 to TopMax
     if TopMsgs(low).msg.ReadCount > TopMsgs(i).msg.ReadCount then
       low = i
     end if
   next
   // replace lowest with high count
   if msg.readcount > TopMsgs(low).msg.ReadCount then
     TopMsgs(low).msg = msg
     TopMsgs(low).count = msg.readcount
   end if
  loop

  sort TopMsgs

  print "***** TOP ";TopMax;" Messages ******"

  for i = TopMax to 1 Step -1
   msg = TopMsgs(i).msg
   print Pad(str(msg.readcount),5);"  From: ";msg.From.Name
   print "      Subj: ";msg.Subject
  next

LogoutUser()

I then ran this like this (for conference 32 on Santronics Online)

wcrun -r top10messages 32

and got this:

Generating top 10 messages....
***** TOP 10 Messages ******
448    From: HECTOR SANTOS
       Subj: New WEB MAIL System
355    From: HECTOR SANTOS
       Subj: Anti-Virus Software
349    From: CHRIS KENWARD
       Subj: BINKP
348    From: JOHN GUILLORY
       Subj: Winserver Memory
339    From: HECTOR SANTOS
       Subj: RE: Winserver Memory
323    From: ARTUR MADEIRA
       Subj: Massive Attack?
319    From: SUE LANE
       Subj: SPAM
310    From: ED SMITH
       Subj: Windows 2000 & 16-bit Doors
295    From: DARYL HUNT
       Subj: Dynamic DNS
294    From: CHRIS KENWARD
       Subj: WC Variables in HTML

© 2001 Hector Santos, http://www.santronics.com