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
/
VIDMENU.SRC
< prev
next >
Wrap
Text File
|
1986-09-26
|
38KB
|
1,195 lines
copy "PARMS.LIB";
video.management.main.menu:
begin
copy "SYSPARMS.FIL";
copy "MEMBER.FIL";
copy "TAPE.FIL";
copy "TSCAN.FIL";
copy "MSCAN.FIL";
copy "SORT.FIL";
copy "STARTUP.FIL";
copy "BOJDATA.LIB";
copy "SCREEN.LIB";
copy "FULLSORT.LIB";
copy "REPORT.LIB";
string wk.str 81;
string wk.str.2 81;
string wk.str.edit 81;
string cur.pattern 30;
string wk.date 9;
string curr.report.type 5;
string pointer wk.sp;
word pointer wk.wp;
byte wk.byte;
byte type.of.sort; {M=member T=tape}
{----byte pr.type; {T=Tapes, X=xrated, I=inventory}
byte pr.sort.select; {M=Member#, T=Title}
byte pointer wk.bp;
byte rpt.ch;
word wk.word;
word wk.key;
word wk.key.2;
word wk.count;
word sort.in.key;
word sort.out.key;
bcd wk.bcd;
external label entry address 5;
string cmp.date.1 9; { for procedure cmp.date }
string cmp.date.2 9;
byte cmp.date.result;
string load.t.num 5; { for procedure load.t.rec }
string load.m.num 5; {for procedure load.m.rec }
word load.t.key;
word load.m.key;
{----------------------------------------------------------------
procedure read.sys: read sys fresh error standard;
procedure read.sys.lk: read sys lock error standard;
procedure write.sys.unlk: write sys unlock error standard;
copy "TRUNCSTR.LIB";
copy "SELPRINT.LIB";
copy "PRINTERS.LIB";
copy "MENU-MBR.LIB";
copy "MENU-TAP.LIB";
{---------------------------------------------------------------}
procedure check.tape:
begin
redefine screen.data;
record chk.rec;
field chk.member.num 4;
field chk.in.num 4;
field chk.out.num 4;
field chk.out.date 8;
field chk.due.date 8;
record chk.list.clear;
record chk.list.rec;
field chk.list.tape 4;
field chk.list.title 30;
field chk.list.out 8;
field chk.list.due 8;
field chk.list.flag 1;
endrec;
string ( ##chk.list.rec * 9);
endrec;
endrec;
endredef;
byte chk.switch; {I= check in O=check out}
byte member.has.tape; {Y=yes , N=no}
{-------------------------------------------------------------------}
{-------- Sub-procedure <list.chk.rec> for <check.tape>-------------}
{-------------------------------------------------------------------}
procedure list.chk.rec:
begin
fill chk.list.clear with ' ';
move #chk.list.rec to wk.sp;
move 0 to wk.count;
move chk.member.num to wk.str;
call trunc.wk.str;
move wk.str to wk.str.2;
move 1 to wk.key;
move 'N' to member.has.tape;
while wk.key <= s.t.nxt do
move wk.key to tscan.key;
read tapescan error standard;
move tscan.member.num to wk.str;
call trunc.wk.str;
if wk.str = wk.str.2 then
move wk.key to t.key;
read tape error standard;
move t.stock.num to wk.str.edit[field, length ##chk.list.tape];
move wk.str.edit to @wk.sp length ##chk.list.tape;
add ##chk.list.tape to wk.sp;
move t.title to wk.str.edit[field, length ##chk.list.title];
move wk.str.edit to @wk.sp length ##chk.list.title;
add ##chk.list.title to wk.sp;
move t.out.date to wk.str.edit[field, length ##chk.list.out];
move wk.str.edit to @wk.sp length ##chk.list.out;
add ##chk.list.out to wk.sp;
move t.due.date to wk.str.edit[field, length ##chk.list.due];
move wk.str.edit to @wk.sp length ##chk.list.due;
add ##chk.list.due to wk.sp;
move s.date to cmp.date.1;
move t.due.date to cmp.date.2;
call cmp.date;
if cmp.date.result = '>' then
move '*' to wk.str.edit;
else
move ' ' to wk.str.edit;
fi;
move wk.str.edit to @wk.sp length ##chk.list.flag;
add ##chk.list.flag to wk.sp;
move 'Y' to member.has.tape;
add 1 to wk.count;
fi;
add 1 to wk.key;
if wk.count >= 10 or wk.key >= s.t.nxt then
if wk.key >= s.t.nxt then
move '>>> Check out list complete.' to status.line;
else
move '>>> Search incomplete- exit screen to continue.'
to status.line;
fi;
call status.line.display;
if wk.key >= s.t.nxt then
exitdo;
else
call get.screen.data;
move #chk.list.rec to wk.sp;
move 0 to wk.count;
fill chk.list.clear with ' ';
fi;
fi;
od;
end;
{- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -}
move 0 to sys.key;
read sys error standard;
chk.get.data:
fill chk.rec with ' ';
move s.date to chk.out.date;
chk.get.data.2:
move 'check' to screen.name;
call get.screen.data;
move ' ' to status.line;
call status.line.display;
move chk.member.num to wk.str;
call trunc.wk.str;
if wk.str = '' then
call find.mem.num;
fill chk.rec with ' ';
move s.date to chk.out.date;
move wk.str to wk.str.edit [field, length ##chk.member.num];
move wk.str.edit to chk.member.num;
goto chk.get.data.2;
fi;
if wk.str = 'END' then
exit
fi;
move chk.out.num to wk.str;
call trunc.wk.str;
move wk.str to wk.str.2;
move chk.in.num to wk.str;
call trunc.wk.str;
if wk.str <> '' and wk.str.2 <> '' then
move 'ERROR- Enter only tape# check in or out, not both.'
to status.line;
call status.line display;
goto chk.get.data.2;
fi;
if wk.str = '' and wk.str.2 = '' then
call list.chk.rec;
if member.has.tape = 'N' then
move '>>> No tapes found for this member.' to status.line;
else
move '>>> Enter tape# or END to exit.' to status.line;
fi;
call status.line.display;
goto chk.get.data.2;
fi;
fill t.rec with ' ';
if wk.str <> '' then
move wk.str to load.t.num;
move 'I' to chk.switch;
else
move wk.str.2 to load.t.num;
move 'O' to chk.switch;
fi;
call load.t.rec;
if load.t.key <> 0 then
move load.t.key to tscan.key;
move chk.member.num to wk.str;
call trunc.wk.str;
move wk.str to wk.str.2;
move t.member.num to wk.str;
call trunc.wk.str;
switch on chk.switch:
'I': begin
move 1 to get.data.skip.count;
if wk.str = '' then
move 'ERROR- Tape not checked out.' to status.line;
call status.line.display;
goto chk.get.data.2;
fi;
if wk.str <> wk.str.2 then
move 'ERROR- Tape checked out to member #'
to status.line;
append wk.str to status.line;
call status.line.display;
goto chk.get.data.2;
fi;
fill chk.in.num with ' ';
fill t.chk.rec with ' ';
fill tscan.member.num with ' ';
end;
'O': begin
move 2 to get.data.skip.count;
if wk.str <> '' then
move 'ERROR- Tape checked out to member# '
to status.line;
append wk.str to status.line;
call status.line.display;
goto chk.get.data.2;
fi;
move chk.member.num to t.member.num;
move chk.member.num to tscan.member.num;
move chk.out.date to t.out.date;
move chk.due.date to t.due.date;
fill chk.out.num with ' ';
move t.count to wk.str;
call trunc.wk.str;
convert wk.str to wk.bcd;
if wk.bcd = 999 then
move 0 to wk.bcd;
fi;
add 1 to wk.bcd;
convert wk.bcd to wk.str;
move wk.str to wk.str.edit[field,length ##t.count];
move wk.str.edit to t.count;
end;
endswitch;
write tapescan error standard;
write tape error standard;
else
move 'ERROR- Tape number not found.' to status.line;
call status.line.display;
switch on chk.switch:
'I': move 1 to get.data.skip.count;
'O': move 2 to get.data.skip.count;
endswitch;
fi;
goto chk.get.data.2;
end;
{---------------------------------------------------------------}
procedure load.t.rec:
begin
move 1 to load.t.key;
while load.t.key < s.t.nxt do
move load.t.key to tscan.key;
read tapescan error standard;
move tscan.stock.num to wk.str;
call trunc.wk.str;
if wk.str = load.t.num then
move load.t.key to t.key;
read tape error standard;
exit;
else
add 1 to load.t.key;
fi;
od;
if load.t.key = s.t.nxt then
move 0 to load.t.key;
fi;
end;
{---------------------------------------------------------------}
procedure load.m.rec:
begin
move 1 to load.m.key;
while load.m.key < s.m.nxt do
move load.m.key to mscan.key;
read memscan error standard;
move mscan.member.num to wk.str;
call trunc.wk.str;
if wk.str = load.m.num then
move load.m.key to m.key;
read member error standard;
exit;
else
add 1 to load.m.key;
fi;
od;
if load.m.key = s.m.nxt then
move 0 to load.m.key;
fi;
end;
{---------------------------------------------------------------}
procedure justify.tape.fields:
begin
move t.stock.num to wk.str;
justify wk.str right length ##t.stock.num;
move wk.str to t.stock.num;
move t.rating to wk.str;
justify wk.str left length ##t.rating;
move wk.str to t.rating;
move t.member.num to wk.str;
justify wk.str right length ##t.member.num;
move wk.str to t.member.num;
end;
{----------------------------------------------------------------}
procedure justify.member.fields:
begin
move m.member.num to wk.str;
justify wk.str right length ##m.member.num;
move wk.str to m.member.num;
move m.zip to wk.str.2;
edit wk.str.2 with 'ZZZZ99999' giving wk.str;
justify wk.str left length ##m.zip;
move wk.str to m.zip;
end;
{--------------------------------------------------------------}
procedure justify.inv.fields:
begin
move t.purchase.price to wk.str.2;
edit wk.str.2 with 'ZZXXXX' giving wk.str;
move wk.str to t.purchase.price length ##t.purchase.price;
move t.retail.price to wk.str.2;
edit wk.str.2 with 'ZZXXXX' giving wk.str;
move wk.str to t.retail.price length ##t.retail.price;
move t.count to wk.str;
justify wk.str right length ##t.count;
move wk.str to t.count;
end;
{----------------------------------------------------------------
procedure printing.menu:
begin redefine screen.data;
field prmenu.option 3;
field prmenu.date 8; endredef;
move ' ' to prmenu.option;
move ' ' to prmenu.date;
do
move 60 to line.counter;
move 'prmenu' to screen.name;
call get.screen.data;
move ' ' to status.line;
call status.line.display;
move s.date to report.date;
move prmenu.date to wk.date;
move prmenu.option to curr.report.type;
move prmenu.option[+2,byte] to pr.sort.select;
switch on curr.report.type:
'MEM': call member.list;
'TAP','INV','XRA','CHM','CHT': call tape.list;
'STI','STO': call tape.list;
'END': exit;
else begin
move 'Invalid Option' to status.line;
call status.line.display;
end;
endswitch;
od;
end;
{-------------------------------------------------------------}
procedure tape.list:
begin
string last.title 46;
string this.title 46;
move 0 to sys.key;
read sys error standard;
move 0 to sort.in.key;
move 0 to sort.out.key;
switch on curr.report.type:
'STI','STO': move "D" to type.of.sort;
else move 'T' to type.of.sort;
endswitch;
move type.of.sort to csort.name.code;
open csort error
open csort output remove error standard;
call full.sort;
move 0 to csort.key;
read csort error standard;
move csort.nxt to wk.key.2;
{*debug* convert csort.nxt to wk.str;
{*debug* display "csort.nxt = ",wk.str; accept wk.str;
move 1 to wk.key;
switch on curr.report.type:
'STI',
'STO',
'INV',
'XRA',
'TAP': begin
move s.wide.printer to printer.to.select;
call select.printer;
end;
'CHM',
'CHT': begin
move s.narrow.printer to printer.to.select;
call select.printer;
move 79 to report.width;
end;
endswitch;
call init.report;
move s.name to heading.1;
switch on curr.report.type:
'INV': move 'Inventory List' to heading.2;
'CHT',
'CHM': move 'Check Out List' to heading.2;
'STI': move 'In-Stock List' to heading.2;
'STO': move 'Out-of-Stock List' to heading.2;
'XRA',
'TAP': begin
call build.store.addr;
move wk.str to heading.2;
end;
endswitch;
move ' ' to this.title;
while wk.key < wk.key.2 do
move this.title to last.title;
move wk.key to csort.key;
{*debug* convert csort.key to wk.str;
{*debug* display "Reading csort rec # ",wk.str,;
read csort error standard;
move csort.code.key to t.key;
{*debug* convert t.key to wk.str;
{*debug* display " Tape Rec # ",wk.str;
read tape error standard;
call justify.tape.fields;
move t.date.out.stock to wk.str;
call trunc.wk.str;
if curr.report.type = 'XRA' and wk.str <> '' then
goto skip.print;
fi;
if curr.report.type = 'TAP' and wk.str <> '' then
goto skip.print;
fi;
if curr.report.type = 'XRA' and t.rating <> 'X' then
goto skip.print;
fi;
if curr.report.type = 'TAP' and t.rating = 'X' then
goto skip.print;
fi;
if curr.report.type = 'STI' and t.date.out.stock <> ' ' then
goto skip.print;
fi;
if curr.report.type = 'STO' and t.date.out.stock = ' ' then
goto skip.print;
fi;
if curr.report.type = 'STI'
or curr.report.type = 'STO'
or curr.report.type = 'CHT'
or curr.report.type = 'CHM'
or curr.report.type = 'INV' then
move ' ' to last.title;
fi;
move t.title to wk.str;
call trunc.wk.str;
move wk.str to this.title;
if this.title <> last.title then
switch on curr.report.type:
'XRA': begin
if t.stock.num <> '9999' then
call pr.tape.list;
fi;
end;
'STI',
'STO': call pr.inv.list;
'TAP': call pr.tape.list;
'INV': begin
if t.stock.num <> '9999' then
call pr.inv.list;
fi;
end;
'CHM',
'CHT': call pr.chk.list;
endswitch;
fi;
skip.print:
add 1 to wk.key;
od;
move s.narrow.printer to printer.to.select;
call select.printer;
call end.report;
close csort error standard;
end;
{-------------------------------------------------------------}
procedure pr.tape.list:
begin
redefine report.line;
field 4;
field pr.t.stock.num 4;
field 3;
field pr.new 3;
field 2;
field pr.t.title 45;
field 6;
field pr.t.star.1 20;
field 4;
field pr.t.star.2 20;
field 4;
field pr.t.rating 2;
field 4;
field pr.t.category 7;
field 4;
endredef;
move t.stock.num to pr.t.stock.num;
move ' ' to pr.new;
move wk.date to cmp.date.1;
move t.date.in.stock to cmp.date.2;
call cmp.date;
if cmp.date.result = '<' or cmp.date.result = '=' then
move 'NEW' to pr.new;
fi;
move t.title to pr.t.title;
move t.star.1 to pr.t.star.1;
move t.star.2 to pr.t.star.2;
move t.rating to pr.t.rating;
move t.category to pr.t.category;
call print.report.line;
end;
{-------------------------------------------------------------}
procedure pr.inv.list:
begin
redefine report.line;
field 5;
field pr.t.stock.num 4;
field 4;
field pr.t.title 45;
field 4;
field pr.t.purchase.price 6;
field 4;
field pr.t.retail.price 6;
field 4;
field pr.t.purchased.from 20;
field 2;
field pr.t.date.in.stock 8;
field 2;
field pr.t.date.out.stock 8;
field 3;
field pr.t.count 3;
field 4;
endredef;
call justify.inv.fields;
move t.stock.num to pr.t.stock.num;
move t.title to pr.t.title;
move t.purchase.price to pr.t.purchase.price;
move t.retail.price to pr.t.retail.price;
move t.purchased.from to pr.t.purchased.from;
move t.date.in.stock to pr.t.date.in.stock;
move t.date.out.stock to pr.t.date.out.stock;
move t.count to pr.t.count;
call print.report.line;
end;
{--------------------------------------------------------------}
procedure pr.chk.list:
begin
redefine report.line;
field 2;
field pr.t.stock.num 4;
field 2;
field pr.t.title 30;
field 4;
field pr.t.member.num 4;
field 4;
field pr.t.out.date 8;
field 2;
field pr.t.due.date 8;
field 5;
field pr.t.overdue 1;
field 6;
endredef;
move t.member.num to wk.str;
call trunc.wk.str;
if wk.str = '' then
exit;
fi;
move t.stock.num to pr.t.stock.num;
move t.title to pr.t.title;
move t.member.num to pr.t.member.num;
move t.out.date to pr.t.out.date;
move t.due.date to pr.t.due.date;
move s.date to cmp.date.1;
move t.due.date to cmp.date.2;
call cmp.date;
if cmp.date.result = '>' then
move '*' to pr.t.overdue;
else
move ' ' to pr.t.overdue;
fi;
call print.report.line;
end;
{-------------------------------------------------------------}
procedure build.store.addr:
begin
move s.addr to wk.str;
call trunc.wk.str;
move wk.str to wk.str.2;
append ' ' to wk.str.2;
move s.city to wk.str;
call trunc.wk.str;
append ',' to wk.str;
append wk.str to wk.str.2;
move s.state to wk.str;
append ' ' to wk.str;
append wk.str to wk.str.2;
move s.zip to wk.str;
call trunc.wk.str;
append ' ' to wk.str;
append wk.str to wk.str.2;
move s.phone to wk.str;
append wk.str to wk.str.2;
move wk.str.2 to wk.str;
end;
{-------------------------------------------------------------}
procedure report.heading:
begin
record pr.hdg.1;
field 4 value ' ';
field 5 value 'Tape#';
field 27 value ' ';
field 5 value 'Title';
field 26 value ' ';
field 8 value 'Starring';
field 38 value ' ';
field 6 value 'Rating';
field 2 value ' ';
field 8 value 'Category';
field 3 value ' ';
byte value 0;
endrec;
record pr.hdg.2;
field 4 value ' ';
field 5 value '-----';
field 27 value ' ';
field 5 value '-----';
field 26 value ' ';
field 8 value '--------';
field 38 value ' ';
field 6 value '------';
field 2 value ' ';
field 8 value '--------';
field 2 value ' ';
byte value 0;
endrec;
record pr.hdg.3;
field 4 value ' ';
field 6 value 'Stock#';
field 8 value ' ';
field 5 value 'Title';
field 39 value ' ';
field 8 value 'Purchase';
field 2 value ' ';
field 6 value 'Retail';
field 4 value ' ';
field 14 value 'Purchased from';
field 8 value ' ';
field 8 value 'In stock';
field 2 value ' ';
field 9 value 'Out stock';
field 2 value ' ';
field 5 value 'Count';
field 2 value ' ';
byte value 0;
endrec;
record pr.hdg.4;
field 4 value ' ';
field 6 value '------';
field 8 value ' ';
field 5 value '-----';
field 39 value ' ';
field 8 value '--------';
field 2 value ' ';
field 6 value '------';
field 4 value ' ';
field 14 value '--------------';
field 8 value ' ';
field 8 value '--------';
field 2 value ' ';
field 9 value '---------';
field 2 value ' ';
field 5 value '-----';
field 2 value ' ';
byte value 0;
endrec;
record pr.hdg.5;
field 3 value ' ';
field 6 value 'Number';
field 2 value ' ';
field 4 value 'Name';
field 32 value ' ';
field 7 value 'Address';
field 62 value ' ';
field 4 value 'Date';
field 6 value ' ';
field 4 value 'Type';
field 2 value ' ';
byte value 0;
endrec;
record pr.hdg.6;
field 3 value ' ';
field 6 value '------';
field 2 value ' ';
field 4 value '----';
field 32 value ' ';
field 7 value '-------';
field 62 value ' ';
field 4 value '----';
field 6 value ' ';
field 4 value '----';
field 2 value ' ';
byte value 0;
endrec;
record pr.hdg.7;
field 1 value ' ';
field 5 value 'Tape#';
field 2 value ' ';
field 5 value 'Title';
field 27 value ' ';
field 7 value 'Member#';
field 5 value ' ';
field 3 value 'Out';
field 7 value ' ';
field 3 value 'Due';
field 5 value ' ';
field 7 value 'Overdue';
field 3 value ' ';
byte value 0;
endrec;
record pr.hdg.8;
field 1 value ' ';
field 5 value '-----';
field 2 value ' ';
field 5 value '-----';
field 27 value ' ';
field 7 value '-------';
field 5 value ' ';
field 3 value '---';
field 7 value ' ';
field 3 value '---';
field 5 value ' ';
field 7 value '-------';
field 3 value ' ';
byte value 0;
endrec;
call print.report.line;
call print.report.line;
switch on type.of.sort:
'D',
'T': begin
switch on curr.report.type:
'XRA',
'TAP':begin
move pr.hdg.1[string] to report.line;
call print.report.line;
move pr.hdg.2[string] to report.line;
call print.report.line;
end;
'STI',
'STO',
'INV': begin
move pr.hdg.3[string] to report.line;
call print.report.line;
move pr.hdg.4[string] to report.line;
call print.report.line;
end;
'CHM',
'CHT': begin
move pr.hdg.7[string] to report.line;
call print.report.line;
move pr.hdg.8[string] to report.line;
call print.report.line;
end;
endswitch;
end;
'M': begin
move pr.hdg.5[string] to report.line;
call print.report.line;
move pr.hdg.6[string] to report.line;
call print.report.line;
end;
endswitch;
end;
{------------------------------------------------------------------}
procedure member.list:
begin
move 0 to sys.key;
read sys error standard;
move 0 to sort.in.key;
move 0 to sort.out.key;
move 'M' to type.of.sort;
move type.of.sort to csort.name.code;
open csort error standard;
call full.sort;
move 0 to csort.key;
read csort error standard;
move csort.nxt to wk.key.2;
move 1 to wk.key;
move s.wide.printer to printer.to.select;
call select.printer;
call init.report;
move s.name to heading.1;
move 'Membership List' to heading.2;
while wk.key < wk.key.2 do
move wk.key to csort.key;
read csort error standard;
move csort.code.key to m.key;
read member error standard;
if m.type = 'A' or m.type = 'L' then
call pr.member.list;
fi;
add 1 to wk.key;
od;
call end.report;
close csort error standard;
end;
{-------------------------------------------------------------}
procedure pr.member.list:
begin
redefine report.line;
field 5;
field pr.m.member.num 4;
field 2;
field pr.m.l.name 20;
field 2;
field pr.m.f.name 12;
field 2;
field pr.m.addr 30;
field 2;
field pr.m.city 20;
field 2;
field pr.m.state 2;
field 2;
field pr.m.zip 9;
field 2;
field pr.m.date.joined 8;
field 4;
field pr.m.type 1;
field 3;
endredef;
call justify.member.fields;
move m.member.num to pr.m.member.num;
move m.l.name to pr.m.l.name;
move m.f.name to pr.m.f.name;
move m.addr to pr.m.addr;
move m.city to pr.m.city;
move m.state to pr.m.state;
move m.zip to pr.m.zip;
move m.date.joined to pr.m.date.joined;
move m.type to pr.m.type;
call print.report.line;
end;
{-------------------------------------------------------------}
copy "MAIL-LBL.LIB";
{-------------------------------------------------------------}
procedure print.label:
begin
call get.label.specs;
move "L" to type.of.sort;
move 0 to sort.in.key;
move 0 to sort.out.key;
call full.sort;
end;
{-------------------------------------------------------------}
{ FULLSORT in/out routines }
{-------------------------------------------------------------}
procedure sort.input:
begin
add 1 to sort.in.key;
move sort.in.key to sort.key;
move 'Y' to sort.rec.present;
switch on type.of.sort;
'L',
'M': begin
if sort.in.key < s.m.nxt then
move sort.in.key to m.key;
read member error standard;
call justify.member.fields;
if type.of.sort = "L" then
if inqlabel.life.annual = "E" then
if m.type[byte] <> "A"
and m.type[byte] <> "L" then
move "E" to m.type[byte];
fi; fi;
if inqlabel.life.annual <> " "
and inqlabel.life.annual <> m.type[byte] then
goto sort.input;
fi;
if inqlabel.month.joined[word] <> " "
and inqlabel.month.joined[word] <> m.date.joined[word] then
goto sort.input;
fi;
if inqlabel.year.joined[word] <> " "
and inqlabel.year.joined[word] <> m.date.joined[+6,word] then
goto sort.input;
fi;
if m.l.name = " "
and m.f.name = " " then
goto sort.input;
fi;
move m.zip to wk.str;
call trunc.wk.str;
else
move 0 to wk.str[byte];
fi;
move m.l.name to wk.str.2;
append wk.str.2 to wk.str;
call trunc.wk.str;
move m.f.name to wk.str.2;
append wk.str.2 to wk.str;
move wk.str to sort.field;
else
move 'N' to sort.rec.present;
fi;
end;
'T': begin
if sort.in.key < s.t.nxt then
move sort.in.key to t.key;
read tape error standard;
switch on curr.report.type:
'CHM',
'CHT': begin
switch on pr.sort.select:
'T': move t.title to sort.field;
'M': begin
move t.member.num to wk.str;
justify wk.str right
length ##t.member.num;
move wk.str to sort.field;
end;
endswitch;
end;
'INV',
'TAP',
'XRA': move t.title to sort.field;
endswitch;
{*debug* convert sort.key to wk.str;
{*debug* display "IN sort.key = ",wk.str,;
{*debug* move sort.field to wk.str;
{*debug* display " Field = ",wk.str;
else
move 'N' to sort.rec.present;
fi;
end;
"D": begin
if sort.key >= s.t.nxt then
move "N" to sort.rec.present;
else
move sort.in.key to t.key;
read tape error standard;
switch on curr.report.type:
"STI": move t.date.in.stock to wk.str;
"STO": move t.date.out.stock to wk.str;
endswitch;
move wk.str[+6,word] to sort.field[+0,word]; {year}
move wk.str[+0,word] to sort.field[+2,word]; {month}
move wk.str[+3,word] to sort.field[+4,word]; {day}
move t.stock.num to sort.field[+6, field, length 4];
move 0 to sort.field[+10,byte];
fi;
end;
endswitch;
end;
{-------------------}
procedure sort.output:
begin
switch on type.of.sort:
"L": begin
if sort.rec.present = "Y" then
move sort.key to m.key;
call process.this.member;
else
if inqlabel.num.wide = "D"
and disk.out.open = "Y" then
call print.all.labels;
move "Y" to end.report.inhibit.form.feed;
close disk.out error standard;
fi;
call end.report;
fi;
exit;
end;
"D",
"M",
"T": begin
add 1 to sort.out.key;
move sort.out.key to csort.key;
if sort.rec.present = 'Y' then
{*debug* convert sort.key to wk.str;
{*debug* display "OUT sort.key = ",wk.str,;
{*debug* move sort.field to wk.str;
{*debug* display " Field = ",wk.str;
move sort.rec to csort.rec;
write csort error standard;
else
move 0 to csort.key;
move sort.out.key to csort.nxt;
write csort error standard;
fi;
end;
endswitch;
end;
{----------------------------------------------------------------}
procedure cmp.date:
begin
move ' ' to cmp.date.result;
move cmp.date.1 to wk.str;
call trunc.wk.str;
move wk.str to cmp.date.1;
move cmp.date.2 to wk.str;
call trunc.wk.str;
move wk.str to cmp.date.2;
if cmp.date.1 = '' or cmp.date.2 = '' then exit fi;
if cmp.date.1 = cmp.date.2 then
move '=' to cmp.date.result;
exit;
fi;
move '<' to cmp.date.result;
if cmp.date.1[+6,field length 2] > cmp.date.2[+6,field length 2] then
move '>' to cmp.date.result;
exit;
fi;
if cmp.date.1[+0,field length 2] > cmp.date.2[+0,field length 2]
and cmp.date.1[+6,field length 2] = cmp.date.2[+6,field length 2] then
move '>' to cmp.date.result;
exit;
fi;
if cmp.date.1[+3,field length 2] > cmp.date.2[+3, field length 2]
and cmp.date.1[+0,field length 2] = cmp.date.2[+0,field length 2] then
move '>' to cmp.date.result;
fi;
end;
{----------------------------------------------------------------
{ M A I N P R O G R A M
{----------------------------------------------------------------
redefine screen.data;
record menu;
field menu.version 3;
field menu.date 8;
field menu.option 2;
endrec;
endredef;
move IPC.area to startup.parms[string] length ##startup.parms;
if todays.date[+2,byte] <> "/"
or todays.date[+5,byte] <> "/" then
display "Invalid program startup";
goto end;
fi;
move data.ext to sys.file.ext;
move data.ext to m.file.ext;
move data.ext to t.file.ext;
move data.ext to tscan.file.ext;
move data.ext to mscan.file.ext;
move my.terminal.type to terminal.type;
move 'VIDSCREN.DAT' to screen.file.name;
open sys error standard;
move 0 to sys.key;
read sys error standard;
open member error standard;
open tape error standard;
open tapescan error standard;
open memscan error standard;
report.exit:
do
move 0 to sys.key;
read sys error standard;
move s.date to menu.date;
move '1.0' to menu.version;
menu.get.data:
fill menu.option with ' ';
move 'menu' to screen.name;
call get.screen.data;
move s.date to menu.date;
switch on menu.option[word]:
'AM': call add.member;
'CM': call change.member;
'AT': call add.tape;
'CT': call change.tape;
'CK': call check.tape;
'EX': exitdo;
'PR': call printing.menu;
'PL': call print.label;
'SP': call printer.set.up;
else begin
move 'invalid option' to status.line;
call status.line.display;
goto menu.get.data;
end;
endswitch;
od;
close sys error standard;
close member error standard;
close tape error standard;
close tapescan error standard;
close memscan error standard;
end;