home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
beehive
/
bbs
/
rover12a.arc
/
ROVER12.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-08-11
|
5KB
|
206 lines
program ROVER;
{Message import/export program for PBBS}
{by Phil Hansford}
{Mysteria}
{818-353-8891 (modem)}
{Sept. 28, 1988}
const
vers: string[5] = '1.2'; {version number}
area: string[2] = 'A0'; {default drive/user}
fnumber: integer = 4; {maximum folder number}
folders : array[1..9] of string[10] = ('General','Occult','Programing',
'Astral','Local','6','7','8','Netmail');
name: boolean = true; {yes, show folder names}
CR = ^M;
NUL= ^@;
SOH= ^A;
ETX= ^C;
const {typed constants}
menu: boolean = true;
export: boolean = true;
import: boolean = false;
do_commandline: boolean = false;
type
str1 = string[1];
str2 = string[2];
str8 = string[8];
str10 = string[10];
str14= string[14];
fileSpec= string[14];
str16= string[16];
str30= string[30];
str64= string[64];
str80= string[80];
buff30 = array[1..30] of byte;
msgtype = array[1..64] of byte;
bufftype = array[1..128] of byte;
indextype = record
date: str8;
next_messages_rec: integer;
next_message_number: integer;
last_msgindex_rec: integer;
end;
msgindextype = record
receiver: str30;
msg_no: integer;
date: str8;
time: str8;
num_of_recs: byte;
start_rec_no: integer;
msgindex_rec_no: integer;
subject: string[26];
sender: str30;
public: byte;
folder: byte;
deleted: byte;
null: byte;
end;
var
{records}
index: indextype;
msgindex: msgindextype;
{booleans}
set_pick, by_number: boolean;
{numbers}
I, K, count: byte;
msgindexrec,
nextrecord, mirecord,
recsRead, start_number,
deleted, public, folder: integer;
msgindex_pointer: integer;
msg: array[1..10] of integer;
{strings}
time, date: str8;
sender1, receiver1: str14;
oldname, newname,
indexname, msgindexname,
messagesname, snapfilename: fileSpec;
commandline: string[20];
subject: string[26];
sender, receiver: str30;
linebuffer: str64;
line: str80;
sparebuffer: string[87];
line1: array[1..8] of str16;
{buffers}
filebuffer, ndxbuffer,
buffer, store,
msgindexbuffer: bufftype;
selectbuffer: array[1..30] of byte;
indexbuffer: array[1..100] of byte;
{files}
textfil, snapfil: text;
oldfil, fil,
newfil, ndxfil,
msgndxfil, messagesfil: file;
{------ Include Files ------}
{The source code is broken into parts
{to make it easier to edit}
{$I MUNDANE.INC} {common routines}
{$I EXPORT.INC} {export code}
{$I IMPORT.INC} {import code}
{---------------------------}
procedure update_logs;
begin
end; {update_logs}
procedure check_commandline;
begin
do_commandline:= (paramCount > 0);
if do_commandline then
commandline:= paramStr(1)
else commandline:= '';
end; {check_commandline}
procedure parse_commandline; {set booleans}
var
I: byte;
begin
if not do_commandline then exit;
if (pos('S', commandline) > 0) and (pos('T', commandline) > 0)
then finis(0);
for I:= 1 to length(commandline) do
case commandline[I] of
'S': begin
export:= true;
import:= false;
end;
'T': begin
export:= false;
import:= true;
end;
'M': menu:= true;
else finis(0);
end; {case}
end; {parse_commandline}
procedure do_menu;
begin
if not menu then exit;
if export then export_menu;
if import then import_menu;
end; {do_menu}
procedure check_commandfile;
var
command_file: str14;
begin
command_file:= 'ROVER.CMD';
if not exists(command_file) then exit;
menu:= false;
export:= false;
close(oldfil);
end; {check_commandfile}
procedure title;
begin
writeln('** ROVER ' + vers + ' -- Message transfer program for PBBS **');
writeln;
writeln('This utility exports PBBS messages to external files.');
writeln('It may also be used to import external message files to PBBS.');
writeln('PBBS files INDEX.PBS, MSGINDEX.PBS, and MESSAGES.PBS must be');
writeln('on the default disk drive.');
writeln;
end; {title}
procedure command_mode;
begin
parse_commandline; {set booleans}
check_commandfile;
{conditional operations based on booleans}
do_menu;
do_export;
do_import;
update_logs;
end; {command_mode}
{-------- Main Program Area ---------}
begin {main}
check_commandline;
title;
command_mode;
finis(1);
end. {program}