home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
PARASOL
/
VIDEOSTO.ARK
/
STARTUP.SRC
< prev
next >
Wrap
INI File
|
1986-07-21
|
10KB
|
339 lines
[limit word number address map mpm table]
master.first.phase.start:
begin
{---------------------------------------------------
{ Medical Office Management System 'PARAMEDIC'
{ Master Start Routine
{ This program sets the system environment for Para-Soft
{ Application Programs. This includes selecting the
{ appropriate drive and user, and executing "STARTUP"
{ Copyright (C) 1983 by Para-Soft
{ All Rights Reserved
{---------------------------------------------------
copy "STARTUP.FIL";
copy "BOJDATA.LIB";
byte print.char;
file print.init,
prn,
record print.char,
text;
external byte IOBYTE address ^h0003;
external label entry address ^h0005;
external word bios.loc address ^h0001;
string wk.accept 12;
string wk.str 40;
word wk.word;
word wk.rem;
word wk.count value 0;
word pointer wk.count.ptr value #wk.count;
byte pointer wk.bp;
word pointer wk.wp;
byte wk.byte;
byte curr.printer value 0;
string program.to.start 81;
string command.line 128;
string command.word 81;
word end.startup.key;
record con.tbl;
byte con.type;
string 15;
endrec;
record prn.tbl;
byte prn.usage;
string 15;
endrec;
word days.this.year;
copy "TRUNCSTR.LIB";
{-----------------------------------------------------------
procedure get.current.printer:
begin
switch on operating.system:
1,3: begin
mcall entry using 156 giving wk.bp;
add 14 to wk.bp;
divide @wk.bp by 16 giving curr.printer;
end;
else
divide IOBYTE by ^h40 giving curr.printer;
endswitch;
end;
{----------------------------------------------------------------
{ S T A R T O F P R O G R A M E X E C U T I O N
{
{ Get command-line and process. Format:
{
{ STARTUP [[ID [=]] xxx ] [ progname [ command-line ]]
{
{ Examples:
{ STARTUP Uses blank id, dflt prog
{ STARTUP VERIFY Uses blank id, prog=VERIFY
{ STARTUP MED Uses id=MED, dflt prog
{ STARTUP ID=DNT Uses id=DNT, dflt prog
{ STARTUP ID=JOE REBUILD ALL Uses id=JOE, prog=REBUILD,
{ cmd-line=ALL
{
{----------------------------------------------------------------
procedure bios.con.stat: goto bios.con.stat;
procedure bios.con.in: goto bios.con.in;
procedure get.cmd.word:
begin
scan command.line for any " ,=~09~"
giving address wk.bp;
move @wk.bp to wk.byte;
move 0 to @wk.bp;
move command.line to command.word;
if wk.byte <> 0 then
add 1 to wk.bp;
fi;
scan @wk.bp[sp] for no " ,=~09~"
giving address wk.bp;
move @wk.bp[sp] to command.line;
end;
move IPC.area to command.line;
convert command.line to upper case; {-for IBM-PC Baby-Blue-}
{----------------------------
{ Find out if MPM or CPM
{----------------------------
mcall entry using 12 giving wk.word;
switch on wk.word:
^h0022: move os.CPM to operating.system;
^h0130: move os.MPM to operating.system;
^h01fe: move os.old.NSTAR to operating.system;
^h01ff: move os.new.NSTAR to operating.system;
endswitch;
{----------------------------------
{ Determine computer-type
{----------------------------------
if operating.system = os.MPM then
move ALTOS.computer to computer.type;
else
switch on bios.loc[+1,byte]:
^he6: move BB2.computer to computer.type;
^hf2: move EXO.computer to computer.type;
endswitch;
fi;
{----------------------------------------------------
{ get terminal number for multi-terminal systems
{----------------------------------------------------
if operating.system = os.CPM then {--if it's CP/M--}
move 0 to my.terminal.num;
else {MP/M, old n/STAR, new n/STAR}
mcall entry using 153 giving ,,,my.terminal.num;
fi;
{------------------------------
{ process the command-line
{------------------------------
scan command.line for no " " giving address wk.bp;
move @wk.bp[sp] to command.line;
move ' ' to company.id;
call get.cmd.word;
if command.word = 'ID' then
call get.cmd.word;
size command.word giving wk.word;
if wk.word > 3 then
display "Id can't be over 3 characters.";
goto end;
fi;
move command.word to company.id;
call get.cmd.word;
size command.word giving wk.word;
if wk.word <= 8 then
move command.word to program.to.start;
else
append command.line to command.word;
move command.word to command.line;
fi;
else
size command.word giving wk.word;
if wk.word <> 0
and wk.word <= 3 then
move command.word to company.id;
call get.cmd.word;
size command.word giving wk.word;
if wk.word <= 8 then
move command.word to program.to.start;
else
append command.line to command.word;
move command.word to command.line;
fi;
else
if wk.word <= 8
and wk.word <> 0 then
move command.word to program.to.start;
else
append command.line to command.word;
move command.word to command.line;
fi;
fi;
fi;
move command.line to startup.cmd.line;
{-------------------------------------------------
{ Get Terminal type
{-------------------------------------------------
mcall entry using 14,0;
mcall entry using 32,0;
open startup.file shared error begin
display "Internal Error, Can't Locate Startup Parameters";
goto end;
end;
move 0 to startup.key;
read startup.file error begin
display "Internal Error: Invalid Startup Information";
goto end;
end;
move startup.con.tbl to con.tbl;
move startup.nxt to end.startup.key;
move my.terminal.num to wk.str[word];
or wk.str[byte] with '0';
display "This is terminal #",wk.str;
and my.terminal.num with ^h0f giving wk.byte;
index con.type with wk.byte giving wk.bp;
move @wk.bp to my.terminal.type;
{-------------------------------------------------
{ Go thru Startup-File and Match on Company-ID
{-------------------------------------------------
retry.co.id.lookup:
move (17 - 1) to startup.key;
while startup.key < end.startup.key do
add 1 to startup.key;
read startup.file error standard;
od until startup.co.code = company.id;
if startup.co.code <> company.id then
display "There is no ID-Code on file for '",;
move company.id to wk.str;
display wk.str,"'";
accept "Enter new ID or 'END': ",wk.str;
convert wk.str to upper case;
move 0 to wk.str[+3,byte];
if wk.str = 'END' then
goto end;
fi;
move wk.str to company.id;
goto retry.co.id.lookup;
fi;
close startup.file error standard;
{--------------------------------------------------
{ Check if this terminal is allowed on this ID
{--------------------------------------------------
and my.terminal.num with ^h0f giving wk.byte;
index startup.con.valid with wk.byte giving wk.bp;
if @wk.bp <> 'Y' then
display "This Terminal is not declared for this ID";
goto end;
fi;
move 0 to wk.byte;
move #startup.con.valid.rec to wk.bp;
while wk.byte < ##startup.con.valid.rec do
if @wk.bp = 'Y' then
move wk.byte to max.terminal.num;
fi;
add 1 to wk.bp;
add 1 to wk.byte;
od;
{--------------------------------------------------
{ Get password if needed (Use BIOS calls for no echo)
{--------------------------------------------------
if startup.password <> ' ' then
display "";
display "Enter Password Below:";
display "MMMMMMMM~0d~WWWWWWWW~0d~XXXXXXXX~0d~",;
add 3 to bios.loc giving bios.con.stat[+1,word];
add 6 to bios.loc giving bios.con.in[+1,word];
do
mcall bios.con.stat giving ,,,wk.byte;
if wk.byte = 0 then
exitdo;
fi;
mcall bios.con.in; {--throw away--}
od;
move #wk.str to wk.bp;
move 0 to wk.count;
do
mcall bios.con.in giving ,,,wk.byte;
and wk.byte with ^h7f;
if wk.byte >= 'a'
and wk.byte <= 'z' then
add ("A"-'a') to wk.byte;
fi;
if wk.byte = ^h0d then
exitdo;
fi;
move wk.byte to @wk.bp;
add 1 to wk.bp;
add 1 to wk.count;
od until wk.count >= ##startup.password;
move 0 to @wk.bp;
if wk.str <> startup.password then
display "";
display "Invalid Password";
goto end;
fi;
fi;
move startup.co.code to company.id;
move startup.prog.ext to prog.ext;
move startup.data.ext to data.ext;
move startup.prog.drive to prog.drive;
move startup.data.drive to data.drive;
move startup.backup.drive to backup.drive;
move startup.sort.drive to sort.drive;
move startup.user to prog.user;
call get.current.printer;
move curr.printer to default.printer;
and my.terminal.num with ^h0f;
{-------------------------------------------------------------
{ Log onto the Drive & User Specified for this Company-ID
{-------------------------------------------------------------
{*debug* convert prog.user to wk.str;
{*debug* display "Changing to User # ",wk.str;
mcall entry using 32,prog.user;
{*debug* move prog.drive to wk.str[word];
{*debug* display "Changing to Drive ",wk.str,":";
subtract "A" from prog.drive giving wk.byte;
mcall entry using 14,wk.byte;
{*debug* display "Starting ID='",;
{*debug* move company.id to wk.str;
{*debug* display wk.str,"'";
if program.to.start = "" then
move startup.dflt.prog to program.to.start;
fi;
move program.to.start to startup.acct;
move "START-GO" to program.to.start;
move '.' to wk.str[byte];
move prog.ext to wk.str[+1];
call trunc.wk.str;
append wk.str to program.to.start;
move startup.parms[field] to IPC.area;
{*debug* display "Executing ",program.to.start;
execute program.to.start;
end;