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
/
MENU-TAP.LIB
< prev
next >
Wrap
Text File
|
1986-10-11
|
7KB
|
227 lines
{----------------------------------------------------------------
{---- tape record ----}
redefine screen.data;
record tape.rec;
field tape.stock.num 4;
field tape.title 45;
field tape.star.1 20;
field tape.star.2 20;
field tape.rating 2;
field tape.category 7;
field tape.purchase.price 6;
field tape.retail.price 6;
field tape.purchased.from 20;
field tape.date.in.stock 8;
field tape.date.out.stock 8;
record tape.chk.rec;
field tape.member.num 4;
field tape.out.date 8;
field tape.due.date 8;
endrec;
field tape.count 3;
endrec;
endredef;
procedure add.tape:
begin
{---- set up defaults ----}
fill tape.rec with ' ';
move s.date to tape.date.in.stock;
move '0' to tape.count;
tape.add.start:
move 'tape' to screen.name;
call get.screen.data;
move ' ' to status.line;
call status.line.display;
{---- test for end or error ----}
move tape.stock.num to wk.str;
call trunc.wk.str;
if wk.str = 'END' then
exit
fi;
if wk.str = '' then
move 'ERROR- stock number missing.' to status.line;
call status.line.display;
goto tape.add.start;
fi;
move 0 to sys.key;
read sys error standard;
move wk.str to load.t.num;
call load.t.rec;
if load.t.key <> 0 then
move 'ERROR- Duplicate stock number.' to status.line;
call status.line.display;
goto tape.add.start;
fi;
read sys lock error standard;
move s.t.nxt to t.key;
move s.t.nxt to tscan.key;
add 1 to s.t.nxt;
write sys unlock error standard;
move tape.rec to t.rec;
write tape lock unlock error standard;
move tape.stock.num to tscan.stock.num;
fill tscan.member.num with ' ';
write tapescan lock unlock error standard;
close tape partial error standard;
close tapescan partial error standard;
end;
{----------------------------------------------------------------
procedure change.tape:
begin
move 0 to sys.key;
read sys error standard;
sch.get.data:
call find.tape.num;
call trunc.wk.str;
if wk.str = '' then
exit;
fi;
if wk.str = 'END' then
exit;
fi;
move wk.str to load.t.num;
call load.t.rec;
if load.t.key = 0 then
move 'ERROR- Tape number not found- Enter END or number.'
to status.line;
call status.line.display;
goto sch.get.data;
fi;
move load.t.key to t.key;
read tape error standard;
move t.rec to tape.rec;
move 'tape' to screen.name;
call get.screen.data;
move tape.rec to t.rec;
move t.stock.num to wk.str;
call trunc.wk.str;
if wk.str = 'END' then
exit;
fi;
write tape error standard;
move t.stock.num to tscan.stock.num;
write tapescan lock unlock error standard;
end;
{----------------------------------------------------------------}
procedure find.tape.num:
begin
redefine screen.data;
record tsearch.rec;
field sch.tape.num 4;
field sch.pattern 30;
record sch.reply.area;
record sch.found.pat;
field sch.pat.tape.num 4;
field sch.pat.title 45;
endrec;
string (##sch.found.pat * 14 );
endrec;
endrec;
endredef;
do
move #sch.pat.tape.num to wk.sp;
move 0 to wk.count;
move 0 to sys.key;
read sys error standard;
sch.get.data:
fill tsearch.rec with ' ';
move 'tsearch' to screen.name;
call get.screen.data;
retry.tape.entry:
fill sch.reply.area with ' ';
move ' ' to status.line;
call status.line.display;
move sch.pattern to wk.str;
call trunc.wk.str;
move wk.str to wk.str.2;
move sch.tape.num to wk.str;
call trunc.wk.str;
if wk.str = '' and wk.str.2 = '' then
move 'ERROR- Enter tape number or title. (? for all)'
to status.line;
call status.line.display;
goto sch.get.data;
fi;
move ' ' to status.line;
call status.line.display;
if wk.str = 'END' then
exit;
fi;
if wk.str <> '' then {-- exit if tapr # entered --}
exit;
fi;
move wk.str.2 to cur.pattern;
convert cur.pattern to upper case;
move 1 to wk.key;
while wk.key < s.t.nxt do
move wk.key to t.key;
read tape error standard;
move t.title to wk.str;
call trunc.wk.str;
convert wk.str to upper case;
if cur.pattern = '?' then
move '?' to wk.str;
fi;
scan wk.str for cur.pattern true
begin
move t.stock.num to wk.str.edit[field, length ##sch.pat.tape.num];
move wk.str.edit to @wk.sp length ##sch.pat.tape.num;
add ##sch.pat.tape.num to wk.sp;
move t.title to wk.str.edit[field, length ##sch.pat.title];
move wk.str.edit to @wk.sp length ##sch.pat.title;
add ##sch.pat.title to wk.sp;
add 1 to wk.count;
end;
add 1 to wk.key;
if wk.count >= 15 or wk.key >= s.t.nxt then
if wk.key >= s.t.nxt then
move '>>> Search complete- Enter END or tape number or ?'
to status.line;
else
move '>>> Search not complete- Exit screen to continue.'
to status.line;
fi;
call status.line.display;
call get.screen.data;
if sch.tape.num <> " "
or sch.pattern <> " " then
move 0 to wk.count;
move #sch.pat.tape.num to wk.sp;
goto retry.tape.entry;
fi;
move #sch.pat.tape.num to wk.sp;
move 0 to wk.count;
fill tsearch.rec with ' ';
fi;
od;
od;
end;
{---------------------------------------------------------------}