🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: demon.ip.developers
Article #886

Re: unread mail

#886
From: John de Rivaz
Date: Sat, 06 Jul 1996 00:00
66 lines
2274 bytes
Thanks to all who replied. A quick re-hash produced this which seems to 
work:

Sub Form_Load ()

Print

Open "c:\winsock\windis32\wdismail.pol" For Input As #1
a$ = ""
While a$ <> "[Mailboxes]"
Input #1, a$
Wend

a$ = ""
While Left$(a$, 7) <> "Number="
  Input #1, a$
  If Left$(a$, 7) <> "Number=" Then
    Let n = InStr(a$, "=")
    Let a$ = Right$(a$, Len(a$) - n)
    If a$ <> "" Then
      list1.AddItem a$
    End If
  End If
Wend

Close #1

For n = 0 To list1.ListCount - 1
Let s$ = "C:\demon\spool\mail\" + list1.List(n) + ".txt"
If Dir(s$) <> "" Then
  Open s$ For Input As #1
    Let c = 0: validated = 0: sw = 0
    While Not EOF(1)
      Input #1, a$
      If Left$(a$, 5) = "From " And last$ = "" Then
        c = c + 1
      End If
      If Left$(a$, 9) = "Status: R" Then
        c = c - 1
        If c < 0 Then c = 0
      End If
    Let last$ = a$
    Wend
    Let sp = 20 - Len(a$)
    Print Tab(5); Str$(c); Tab(10); list1.List(n)
    Close #1
End If
Next n

End Sub

A control with the word "Thanks" on it and "End" in the code and a 
hidden list 1 completes the program.

-- 
Sincerely,     ****************************************
               * Publisher of        Longevity Report *
John de Rivaz  *                     Fractal Report   *
               *          details on request          *
               ****************************************
    In the information age, sharing can increase world
    wealth enormously, because giving information does
              not decrease your information.
     http://ourworld.compuserve.com/homepages/JohndeR                   
           Fast loading, very few slow pictures
Technical Details
Message-ID: <402522057wnr@longevb.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <303048688wnr@longevb.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bb05,74043d7991f5707b
X-Google-Attributes: gid10bb05,public
From: John de Rivaz <John@longevb.demon.co.uk>
Subject: Re: unread mail
Date: 1996/07/06
Message-ID: <402522057wnr@longevb.demon.co.uk>
X-Deja-AN: 163992994
x-nntp-posting-host: longevb.demon.co.uk
references: <303048688wnr@longevb.demon.co.uk>
x-mail2news-path: relay-4.mail.demon.net!post.demon.co.uk!longevb.demon.co.uk
organization: Myorganisation
reply-to: John@longevb.demon.co.uk
newsgroups: demon.ip.developers