FIDO MESSAGES

 BBS: Inland Empire Archive
Date: 12-07-92 (07:49)             Number: 369
From: ZACK JONES                   Refer#: NONE
  To: TOM CARROLL                   Recvd: NO  
Subj: FIDO MESSAGES                  Conf: (2) Quik_Bas
Hello Tom!

04 Dec 92, Tom Carroll writes to All:

 TC> Does anyone know how to get the Destination Zone and Origin Zone numbers
 TC> from a fido style .MSG?

Here's something I picked up some time ago - hopefully this
will help. Credit, of course, goes to Marshall Emm.


'By: Marshall Emm
REM Define the header of a Fido message
TYPE msghdr
 FromUserName AS STRING * 36
   ToUserName AS STRING * 36
      Subject AS STRING * 72
     DateTime AS STRING * 20
    TimesRead AS INTEGER
     DestNode AS INTEGER
     OrigNode AS INTEGER
         Cost AS INTEGER
      OrigNet AS INTEGER
      DestNet AS INTEGER
         Fill AS STRING * 8
      ReplyTo AS INTEGER
    Attribute AS INTEGER
    NextReply AS INTEGER
END TYPE

DIM Header AS msghdr
f$ = "d:2.msg"

OPEN f$ FOR BINARY AS 1
  GET 1, 1, Header
  size = LOF(1) - LEN(Header) + 1:  Message$ = STRING$(size, 0)
  GET 1, LEN(Header) + 1, Message$ 'text of message, i.e.
  '                                everything after the header
CLOSE

PRINT "Message file: "; f$
PRINT
PRINT "FromUserName: "; Header.FromUserName
PRINT "  ToUserName: "; Header.ToUserName
PRINT "     Subject: "; Header.Subject
PRINT
PRINT "     OrigNet: "; Header.OrigNet
PRINT "    OrigNode: "; Header.OrigNode
PRINT "     DestNet: "; Header.DestNet
PRINT "    DestNode: "; Header.DestNode
PRINT
PRINT "    DateTime: "; Header.DateTime
PRINT "   TimesRead: "; Header.TimesRead
PRINT "        Cost: "; Header.Cost
PRINT
PRINT "     ReplyTo: "; Header.ReplyTo
PRINT "   Attribute: "; Header.Attribute
PRINT "   NextReply: "; Header.NextReply
PRINT
PRINT Message$
'now the fun starts if you want to format the text of Message$, which
'is a single "line."

Zack

--- GoldED 2.40
 * Origin: Zack's Shack San Antonio, TX  (210) 653-2115 (1:387/641)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET