TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: GEORGE BLECK
from: CHRIS ADAMS
date: 1995-03-21 18:38:00
subject: Message Base Formats

On (19 Mar 95) George Bleck wrote to All...
 GB> Does anyone have the record structures for the more popular BBS message
 GB> base formats (Fido , JAM, Huson ).  I can't seem to find them
 GB> anywhere...
 
*.MSG (Squish will follow. May be large, so tell if it gets munched)
$IF 0
 Working with basic, it might be easier to use and explain in a different 
ay.
 I'll edit out some of the confusion here, and work with stright hex values.
 Think of the values as two seperate values making a INTEGER.  For example,
 0x0001 would be a value of 00h and a value of 01h making the INTEGER.  But
 remember, it will actually be backwards in basic, so byte 187 would be 01h
 and byte 188 would be 00h.  If you wanted the message to be MSGPRIVATE with 

 MSGFILE, (File Attach), it would be 00h as byte 188 and 01h + 10h, or 11h as
 byte 187.  Remember, the values for each byte are added up for each field to
 make up the INTEGER.
                       /~~~~~ Second byte of INTEGER
                     /   /~~~ First byte of INTEGER
                   /   /
    'MSGPRIVATE 0x00 01 '/* For addressee *ONLY*
    'MSGCRASH   0x00 02 '/* High priority    
    'MSGREAD    0x00 04 '/* Was read by addressee
    'MSGSENT    0x00 08 '/* Was sent by FidoMail
    'MSGFILE    0x00 10 '/* SUBJ=file(s) to send
    'MSGFWD     0x00 20 '/* Msg from & to elsewhere
    'MSGORPHAN  0x00 40 '/* Msg destination unknown
    'MSGKILL    0x00 80 '/* Delete after sending
    'MSGLOCAL   0x01 00 '/* Msg is Local, not Net
    'MSGHOLD    0x02 00 '/* Hold msg for pickup
    'MSGXX2     0x04 00 '/*           
    'MSGFRQ     0x08 00 '/* SUBJ=file(s) to get 
    'MSGRRQ     0x10 00 '/* Msg Receipt requested
    'MSGCPT     0x20 00 '/* Msg is a Msg Receipt
    'MSGARQ     0x40 00 '/* Audit Trail requested
    'MSGURQ     0x80 00 '/* SUBJ=files(s) to UPD
 Maybe this will help you a bit more.  This is a example of a parsing 
unction
 for the message attributes which I have used for my SqRead program and is
 actually for a SQUISH Base Editor, but the standard is the same.  It may be 

 bit crude, and some may laugh, but it works! :-)  Notice that I've made the
 INTEGER into a 2 byte string prior and now splitting the INTEGER into two
 parts and back into a ASC value of each to parse.  I go from the highest
 value and break it down as I go along and subtract the matching value.  This
 FUNCTION will return the actual attribute names to display to the screen.
$ENDIF
   DECLARE FUNCTION GetAttrib$ ()
   FUNCTION GetAttrib$
  '--------------------------------------------------------------------
  Attribute$ = ""
    Attr = ASC(LEFT$(ATTRIB$, 1))
       IF Attr >= 128 THEN
         Attr = Attr - 128
           Attribute$ = " Kill/Sent"
       END IF
       IF Attr >= 64 THEN
         Attr = Attr - 64
           Attribute$ = " Orphan" + Attribute$
       END IF
       IF Attr >= 32 THEN
         Attr = Attr - 32
           Attribute$ = " FWD" + Attribute$
       END IF
       IF Attr >= 16 THEN
         Attr = Attr - 16
           Attribute$ = " F/A" + Attribute$
       END IF
       IF Attr >= 8 THEN
         Attr = Attr - 8
           Attribute$ = " Sent" + Attribute$
       END IF
       IF Attr >= 4 THEN
         Attr = Attr - 4
           Attribute$ = " Rec'd" + Attribute$
       END IF
       IF Attr >= 2 THEN
         Attr = Attr - 2
           Attribute$ = " Crash" + Attribute$
       END IF
       IF Attr = 1 THEN
           Attribute$ = " PVT" + Attribute$
       END IF
    Attr = ASC(MID$(ATTRIB$, 2, 1))
       IF Attr >= 128 THEN
         Attr = Attr - 128
         Attribute$ = Attribute$ + " URQ"
       END IF
       IF Attr >= 64 THEN
         Attr = Attr - 64
         Attribute$ = Attribute$ + " ARQ"
       END IF
       IF Attr >= 32 THEN
         Attr = Attr - 32
         Attribute$ = Attribute$ + " CPT"
       END IF
       IF Attr >= 16 THEN
         Attr = Attr - 16
         Attribute$ = Attribute$ + " RRQ"
       END IF
       IF Attr >= 8 THEN
         Attr = Attr - 8
         Attribute$ = Attribute$ + " FRQ"
       END IF
       IF Attr >= 4 THEN
         Attr = Attr - 4
         Attribute$ = Attribute$ + " XX2"
       END IF
       IF Attr >= 2 THEN
         Attr = Attr - 2
         Attribute$ = " HOLD" + Attribute$
       END IF
       IF Attr = 1 THEN
         Attribute$ = " LOCAL" + Attribute$
       END IF
   GetAttrib$ = Attribute$
   '------------------------------------------------------------------------
   END FUNCTION
$IF 0
Sure... As a matter of fact, I am currently working on a *.MSG netmail
read/write/reply program.  I could just tell ya to look at the FTSC
documentation, but I'll save you a step and give ya the Type-End Type
for a *.MSG netmail message....
$ENDIF
TYPE NetMsg
   FromUser AS STRING * 36     'Terminated by CHR$(0)
   ToUser AS STRING * 36       'Terminated by CHR$(0)
   Subject AS STRING * 72      '* See NOTE(1)
   DateTime AS STRING * 20     'Message body was last edited.
   TimesRead AS INTEGER        'Number of times message has been read.
   DNode AS INTEGER            'Destination node.
   ONode AS INTEGER            'Originating node.
   Cost AS INTEGER             'cost.
   ONet AS INTEGER             'Origin Net.
   DNet AS INTEGER             'Destination Net.
   DZone AS INTEGER            'Destination Zone.
   OZone AS INTEGER            'Origin Zone.
   DPoint AS INTEGER           'Destination Point.
   OPoint AS INTEGER           'Origin Point.
   ReplyTo AS INTEGER          'Message to which this is a reply.
   Attribute AS INTEGER        '* See NOTE(2).
   NextReply AS INTEGER        'Message which replies to this message.
   Text AS STRING * 1730       '* See NOTE(3)
END TYPE
'* NOTE(1): If one or more of the FileAttached, FileRequest, or
'           FileUpdateReq are set in the Attribute then the Subject
'           field is interperted as a list of file specs which may
'           include wildcards and other system-dependant data.  The list
'           is in the form [ FileSpec { Sep FileSpec } ] Null
'           where FileSpec is up to you and Sep = (" " | ",") { " " }
'
'* NOTE(2): Attribute  bit  meaning
'                      ~~~  ~~~~~~~
'                        0  Private
'                        1  Crash
'                        2  Recd
'                        3  Sent
'                        4  FileAttached
'                        5  InTransit
'                        6  Orphan
'                        7  KillSent
'                        8  Local
'                        9  HoldForPickup
'                       10  unused
'                       11  FileRequest
'                       12  ReturnRecieptRequest
'                       13  IsReturnReciept
'                       14  AuditRequest
'                       15  FileUpdateRequest
'
'* NOTE(3): Message text can be unbounded and null terminated.  It is
'           set to approximately 21 lines of 80 column text in the above
'           type-end type.  To read in the text of any length netmail
'           message, I'd suggest opening the *.MSG as a binary file and
'           reading in byte by byte until EOF(1)
 ' *.MSG BASIC .BI Structure
 '-------------------------------------------------------------------------
  TYPE Message
     from        AS STRING * 36 ' Author of message as ASCIIZ string.
     to          AS STRING * 36 ' Intended recipient as ASCIIZ string.
     subj        AS STRING * 72 ' Subject of message as ASCIIZ string.
     date        AS STRING * 20 ' Creation date/time FTSC as ASCIIZ string.
     times       AS INTEGER     ' Times read (obsolete, notused by Opus).
     dest        AS INTEGER     ' FidoNet: Destination node.
     orig        AS INTEGER     ' FidoNet: Origination node.
     cost        AS INTEGER     ' FidoNet: Cost of sending message (cents).
     orignet     AS INTEGER     ' FidoNet: Origination Local Network.
     destnet     AS INTEGER     ' FidoNet: Destination Local Network.
     datewritten AS LONG        ' Msg creation date. LONG DOS Date.
     datearrived AS LONG        ' Msg arrival date. LONG DOS Date.
     reply       AS INTEGER     ' MsgNo that this message replies to.
     attr        AS INTEGER     ' Message handling and behavior flags.
     up          AS INTEGER     ' MsgNo that replies to this message.
  END TYPE
'Here's a quick-n-dirty * netmail reader using BINARY mode.
DIM FromUser AS STRING * 36, ToUser AS STRING * 36, Subject AS STRING * 72
DIM DateTime AS STRING * 20
'DIM TimesRead%, DNode%, ONode%, Cost%, ONet%, DNet%, DZone%, OZone%
'DIM DPoint%, OPoint%, ReplyTo%, Attrib%, NextRep%
DIM Char AS STRING * 1
FF% = FREEFILE
NetMSG$=Command$
OPEN NetMsg$ FOR BINARY AS #FF%
COLOR 15, 0: CLS : LOCATE 1, 1, 0
SEEK #FF%, 1
GET #FF%, , FromUser$: PRINT "BY: "; FromUser$; LEN(FromUser$)
GET #FF%, , ToUser$: PRINT "TO: "; ToUser$; LEN(ToUser$)
GET #FF%, , Subject$: PRINT "RE: "; Subject$; LEN(Subject$)
GET #FF%, , DateTime$: PRINT "Date/Time: "; DateTime$; LEN(DateTime$)
PRINT
GET #FF%, , TimesRead%: PRINT "Times Read: "; TimesRead%
GET #FF%, , DNode%: PRINT "Dest. Node: "; DNode%
GET #FF%, , ONode%: PRINT "Orig. Node: "; ONode%
GET #FF%, , Cost%: PRINT "Cost: "; Cost%
GET #FF%, , ONet%: PRINT "Orig. Net: "; ONet%
GET #FF%, , DNet%: PRINT "Dest. Net: "; DNet%
GET #FF%, , DZone%: PRINT "Dest. Zone: "; DZone%
GET #FF%, , OZone%: PRINT "Orig. Zone: "; OZone%
GET #FF%, , DPoint%: PRINT "Dest. Point: "; DPoint%
GET #FF%, , OPoint%: PRINT "Orig. Point: "; OPoint%
GET #FF%, , ReplyTo%: PRINT "Reply To #: "; ReplyTo%
GET #FF%, , Attribx%: PRINT "Attribute: "; Attribx%
GET #FF%, , NextRep%: PRINT "Next Reply: "; NextRep%
PRINT
PRINT "Press Any Key To View Text"; : SLEEP
CLS : C% = 0
DO UNTIL EOF(FF%)
   Row% = CSRLIN: Col% = POS(0)
   IF Row% = 23 THEN
      LOCATE 24, 1, 0: PRINT "Press Any Key For Next Page..."; : SLEEP
      CLS
   END IF
   GET #FF%, , Char$: PRINT Char$;
LOOP
SLEEP: CLOSE: END
... Borg Bumper Sticker:  "If you can read this, you're irrelevant."
--- PPoint 1.88
---------------
* Origin: The Point of Obfuscation! (1:212/2001.5)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.