Category : Communication (modem) tools and utilities
Archive   : MRUN200.ZIP
Filename : MRUN200B.WAS

 
Output of file : MRUN200B.WAS contained in archive : MRUN200.ZIP
;MailRun v2.00: Part B, changesettings
;1992 Gerald P. Sully, all rights reserved.

#define MRUN200B
#define MRUN200BC

#include "mrun200.h"

#comment
********************************************************

MAIN()

Calls checkchild(), checkdir(), settingsbox(),
loadsettings(), changemailrun(), makemailrunlist(),
menudim(), getfilenames(), newmailrun(), interfaceon()
writesettings(), findstring(), checkchanged(),
changemrundir()

Allows the user to change the settings in the [MailRun]
section of the *.MRN file.

********************************************************
#endcomment

proc main
string LastMRunDir, LastMailDir, LastReplyDir
string LastDLDir, LastULDir, LastMRun
integer MakeDirError = 0
integer dialogstatus
menudim()
checkchild()
getfilenames()
LastMRun = MailRun
loadsettings()
assign LastMailDir MailDir
assign LastReplyDir ReplyDir
assign LastDLDir DownloadDir
assign LastULDir UploadDir
if FLAGS & DEFAULTS
MailRunList = "mailrun.ini"
MailRunTrunc = "mailrun.ini"
LastMRunDir = MailRunDir
else
findfirst MailRun
MailRunTrunc = $FILENAME
makemailrunlist()
endif
FLAGS &= UNCHANGED
settingsbox()
if !(FLAGS & DEFAULTS)
disable CTRL 242
endif
if LogRun == 0
disable CTRL 71
disable CTRL 72
endif
if FLAGS & RUNNING
disable CTRL 170
endif
if FLAGS & NEW
newmailrun()
LastMRun = MailRun
endif
interfaceon()
while 1
dialogstatus = $DIALOG
switch dialogstatus
case 10
;User selected "Save"
;if the directories chosen in settingsbox()
;don't exist, create them
MakeDirError = 0
if FLAGS & DEFAULTS
MakeDirError = checkdir(MakeDirError, &MailRunDir, LastMRunDir)
endif
MakeDirError = checkdir(MakeDirError, &MailDir, LastMailDir)
MakeDirError = checkdir(MakeDirError, &ReplyDir, LastReplyDir)
MakeDirError = checkdir(MakeDirError, &DownloadDir, LastDLDir)
MakeDirError = checkdir(MakeDirError, &UploadDir, LastULDir)
if MakeDirError == 0
;if all directories were successfully created
chdir MailRunDir
writesettings()
else
updatedlg 128
endif
FLAGS &= UNCHANGED
endcase
case 11
;User selected "Done"
if checkchanged()
;if user has no unsaved changes...
if (FLAGS & DEFAULTS) && !(findstring(LastMRunDir, MailRunDir))
;if user has changed the MailRun Directory
changemrundir(LastMRunDir)
updatedlg 128
else
exit
endif
endif
endcase
case 70
;User selected the Log MailRun checkbox
if LogRun == 0
;If logging was turned off, disable the other checkboxes
disable CTRL 71
disable CTRL 72
else
;Otherwise, enable the checkboxes
enable CTRL 71
enable CTRL 72
endif
FLAGS |= CHANGED
updatedlg 1
endcase
case 170
;User changed mailrun with combobox
if checkchanged()
changemailrun()
LastMRun = MailRun
updatedlg -1
else
findfirst MailRun
MailRunTrunc = $FILENAME
updatedlg 512
endif
endcase
case 230
case 231
case 232
case 233
case 234
case 235
case 236
case 237
case 238
case 239
case 240
case 241
case 242
case 71
case 72
case 73
FLAGS |= CHANGED
endcase
endswitch
endwhile
endproc


#comment
********************************************************

CHECKDIR()

Called by main()

Creates a directory. If the directory already exists or
was successfully created, a value of 0 is returned. If
an error occurs, the name of NewDir is changed to that
of OldDir, and a value of 1 is returned.

********************************************************
#endcomment

func checkdir : integer
intparm MakeDirError
strparm NewDir, OldDir
if MakeDirError == 0
chdir NewDir
if FAILURE
mkdir NewDir
if FAILURE
usermsg "Unable to create directory %s" NewDir
MakeDirError = 1
NewDir = OldDir
endif
endif
endif
return MakeDirError
endfunc


#comment
********************************************************

NEWMAILRUN()

Called by parsedialog()

Calls fverify(), updatemrn(), makemrn(), makemailrunlist()

Prompts the user for the name of a new *.MRN file, checks
the name, and calls routines to create it.

********************************************************
#endcomment

proc newmailrun
string NewRun
;Make sure the entered MailRun ID is the correct length
;and that it doesn't already exist
while 1
NewRun = ""
sdlginput "New MailRun" \
"Enter the ID of the new mailrun:" NewRun
if FAILURE
exit
endif
strlwr NewRun
if not fverify(NewRun)
usermsg \
"A mailrun ID must be a valid DOS file name without the extension."
elseif strfind MailRunList NewRun
errormsg "That MailRun already exists!"
else
exitwhile
endif
endwhile

;Update the previous mailrun
updatemrn()
delfile MailRun
;Create the new mailrun
strfmt MailRunTrunc "%s.mrn" NewRun
makemrn()
makemailrunlist()
updatedlg -1
endproc


#comment
********************************************************

CHANGEMRUNDIR()

Called by parsedialog()

Calls movefiles(), cleanup()

Requests confirmation, moves all MailRun support files
to the new MailRun Directory, and shuts down so that the
user can restart.

********************************************************
#endcomment

proc changemrundir
strparm LastMRunDir
string WarnMsg
integer Response
strfmt WarnMsg "All MailRun files will be moved to`r`n`r`n\
%s`r`n`r`nand MailRun will have to be restarted.`r`n`r`nDo you wish \
continue?" MailRunDir
sdlgmsgbox "MailRun Message" WarnMsg QUESTION YESNO Response 2
switch Response
case 6
;User selected "Yes"
profilerd cleanupfile "cleanup" "LastMRun" MailRun
findfirst MailRun
MailRunTrunc = $FILENAME
profilewr MailRunIni "MailRun" "MailRunDir" MailRunDir
movefiles(LastMRunDir, MailRunDir, "MRUN200?.WAS")
movefiles(LastMRunDir, MailRunDir, "MRUN200?.WAX")
movefiles(LastMRunDir, MailRunDir, "MRUN200.H")
movefiles(LastMRunDir, MailRunDir, "*.MRN")
movefiles(LastMRunDir, MailRunDir, "*.?DX")
movefiles(LastMRunDir, MailRunDir, "*.?BF")
movefiles(LastMRunDir, MailRunDir, "MRUNICON.DLL")
movefiles(LastMRUNDir, MailRunDir, "MRUNBKG.BMP")
cleanup()
endcase
case 7
;User selected "No"
MailRunDir = LastMRunDir
endcase
endswitch
endproc


#comment
********************************************************

MOVEFILES()

Called by changemrundir()

Calls makefullname()

Moves files matching the given filespec from their current
location to the MailRun directory.

********************************************************
#endcomment

proc movefiles
strparm OldDir, NewDir, Spec
string OldFile, NewFile, OldSpec
OldSpec = makefullname(OldDir, Spec)
findfirst OldSpec
while FOUND
OldFile = makefullname(OldDir, $FILENAME)
NewFile = makefullname(NewDir, $FILENAME)
copyfile OldFile NewFile
delfile OldFile
findnext
endwhile
endproc


#comment
********************************************************

SETTINGSBOX()

Called by main()

Displays the MailRun Settings dialog box.

********************************************************
#endcomment

proc settingsbox
destroydlg
HelpPage = 4
dialogbox 15 36 340 222 15 "MailRun Settings" HELPID HelpPage
groupbox 10 28 200 96 "Directories" shadow
text 16 42 71 8 right "MailRun Directory:"
text 16 58 71 8 right "Mail Directory:"
text 16 74 71 8 right "Reply Directory:"
text 16 90 71 8 right "Download Directory:"
text 16 106 71 8 right "Upload Directory:"
editbox 91 56 110 12 MailDir
editbox 91 72 110 12 ReplyDir
editbox 91 88 110 12 DownloadDir
editbox 91 104 110 12 UploadDir
groupbox 224 28 102 96 "Parameters" shadow
text 234 42 62 8 right "Dial Attempts:"
text 234 58 62 8 right "Dial Timeout:"
text 234 74 62 8 right "Dial Pause:"
text 234 90 62 8 right "Idle Timeout:"
text 234 106 62 8 right "Packets to Save:"
editbox 300 40 16 12 DialAttempts
editbox 300 56 16 12 DialTimeout
editbox 300 72 16 12 DialPause
editbox 300 88 16 12 IdleTime
editbox 300 104 16 12 SavePackets
groupbox 10 132 124 59 "Logging" shadow
checkbox 18 144 112 12 "Capture mailrun to log file" LogRun
checkbox 18 158 112 12 "Append to existing log file" AppendLog
checkbox 18 172 112 12 "Capture ANSI codes in log file" AnsiInLog
checkbox 18 200 134 12 "Filter duplicates from d/l database" NewfileFilter
groupbox 144 132 184 59 "Utilities" shadow
text 145 146 65 8 right "Archive Utility:"
text 145 160 65 8 right "QWK Mail Reader:"
text 145 174 65 8 right "Log File Viewer:"
editbox 214 144 107 12 Archiver
editbox 214 158 107 12 QWKReader
editbox 214 172 107 12 LogViewer
pushbutton 191 200 40 14 "&Save" normal default
pushbutton 252 200 40 14 "&Done" normal
text 100 11 52 8 right "Settings for:"
combobox 156 9 72 42 MailRunList MailRunTrunc sort
editbox 91 40 110 12 MailRunDir
enddialog
endproc





  3 Responses to “Category : Communication (modem) tools and utilities
Archive   : MRUN200.ZIP
Filename : MRUN200B.WAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/