BBS: Inland Empire Archive Date: 07-05-92 (06:54) Number: 162 From: SEAN HAWTHORNE Refer#: NONE To: TOM CARROLL Recvd: NO Subj: Question about .MSG progr Conf: (2) Quik_Bas
-=> Quoting Tom Carroll to Sean Hawthorne <=-
TC> Could I possibly look at that code too? I'm trying to write
TC> a routine that I can send a message and file attach outside the BBS
TC> and FrontDoor. I have the specs, but they are kind of foggy. If I
TC> could see your code as an example, that would really clear things up.
This will help you on the message format, and if you are trying to get
a connection into the fido system, I would suggest looking for a copy
of the Binkley source code. It's "C" <Ugh> but it does show the codes
to send when and how fairly well.
____________O/______________________O/___________________O/_____________
O\ O\ O\
REM
REM *** MAILPRNT V2.00 (C)1991 Sean Hawthorne ***
REM Syntax: Mailprnt *.msg (Wild cards not allowed)
REM
ON ERROR GOTO errmsg:
openmail:
TYPE headertype
fromname AS STRING * 36
toname 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 headertype
DIM messagebyte AS STRING * 1
filename$ = COMMAND$
OPEN filename$ FOR BINARY AS #1
lenght% = LOF(1) - 190
IF lenght% <= 0 THEN GOTO killfile:
Getmail:
GET #1, 1, header
Editsubject:
xc = INSTR(header.subject, "Re:")
IF xc = 0 THEN
subject$ = header.subject
GOTO printheader:
END IF
subject$ = MID$(header.subject, xc + 3, LEN(header.subject) - (xc + 3))
printheader:
PRINT ""
PRINT STRING$(78, "=")
PRINT " Fm:"; header.fromname; TAB(50); header.datetime
PRINT " To:"; header.toname
PRINT " Re:"; subject$
PRINT STRING$(78, "=")
printmessage:
messageline$ = ""
FOR xd = 1 TO lenght%
GET #1, , messagebyte
IF messagebyte = CHR$(1) THEN GOSUB stripline:
IF messagebyte > CHR$(127) THEN messagebyte = ""
IF messagebyte < CHR$(32) AND messagebyte > CHR$(13) THEN messagebyte = ""
IF messagebyte < CHR$(13) THEN messagebyte = ""
IF messagebyte = CHR$(13) THEN GOSUB printline:
messageline$ = messageline$ + messagebyte
IF LEN(messageline$) >= 80 THEN GOSUB wordwrap:
NEXT xd
Closemail:
CLOSE #1
PRINT ""
PRINT STRING$(19, "="); " MAILPRNT V2.00 (C)1991 Sean
Hawthorne "; STRING$(19, "=")
END
wordwrap:
x = 80
i = 0
WHILE i = 0
a$ = MID$(messageline$, x, 1)
IF a$ = CHR$(32) THEN i = x
x = x - 1
WEND
temp$ = messageline$
messageline$ = MID$(temp$, 1, x)
GOSUB printline:
messageline$ = MID$(temp$, x + 2, LEN(temp$))
RETURN
printline:
PRINT messageline$
xe = INSTR(messageline$, "* Origin:")
IF xe <> 0 THEN GOTO Closemail:
messageline$ = ""
messagebyte = ""
RETURN
stripline:
WHILE messagebyte <> CHR$(13)
GET #1, , messagebyte
WEND
messagebyte = ""
RETURN
killfile:
CLOSE #1
KILL filename$
PRINT
PRINT " Mailprnt V2.00 (C)1991 Sean Hawthorne "
END
errmsg:
PRINT ""
PRINT "Syntax: MAILPRNT *.msg (Sorry no wildcards)"
PRINT ""
PRINT "MAILPRNT V2.00 (C)1991 Sean Hawthorne"
PRINT ""
END
... This is a tagline virus: go ahead and copy me!
--- Blue Wave/Max v2.10
* Origin: TechTalk, Calgary Ab (403)285-4168/280-4938 VHST (1:134/40.0)

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