mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-26 18:04:07 +00:00
Upload
Digital Research
This commit is contained in:
44
MPM OPERATING SYSTEMS/MPM-86/MISC DRI DISKS/09/SCAN.PLI
Normal file
44
MPM OPERATING SYSTEMS/MPM-86/MISC DRI DISKS/09/SCAN.PLI
Normal file
@@ -0,0 +1,44 @@
|
||||
scan:
|
||||
proc;
|
||||
%replace
|
||||
true by '1'b,
|
||||
false by '0'b;
|
||||
dcl
|
||||
f_stack(8) file variable external,
|
||||
f_top fixed external,
|
||||
accum char (128) var external,
|
||||
line char (128) var static init('');
|
||||
dcl
|
||||
c char(1),
|
||||
i fixed;
|
||||
do while(true);
|
||||
if length(line) = 0 then
|
||||
get file(f_stack(f_top)) edit(line) (a);
|
||||
else
|
||||
line = substr(line,length(accum)+1);
|
||||
i = verify(line,' ');
|
||||
if i = 0 then
|
||||
line = '';
|
||||
else
|
||||
do;
|
||||
line = substr(line,i);
|
||||
accum = substr(line,1,1);
|
||||
if index('[]->;().,"',accum) ~= 0 then
|
||||
return;
|
||||
do i = 2 to length(line);
|
||||
c = substr(line,i,1);
|
||||
if index(' []->;().,',c) ~= 0 then
|
||||
do;
|
||||
accum = substr(line,1,i-1);
|
||||
if c ~= '.' then
|
||||
return;
|
||||
if verify(accum,'0123456789') ~= 0 then
|
||||
return;
|
||||
end;
|
||||
end;
|
||||
accum = line;
|
||||
return;
|
||||
end;
|
||||
end;
|
||||
end scan;
|
||||
|
||||
Reference in New Issue
Block a user