tldm-universe/Ardent/UV/BP/T.ATT

205 lines
4.9 KiB
Plaintext
Raw Permalink Normal View History

2024-09-09 21:51:08 +00:00
*******************************************************************************
*
* Support of PR1ME INFORMATION subroutine '-SUBSTRINGS'
*
* Module %M% Version %I% Date %H%
*
* (c) Copyright 1998 Ardent Software Inc. - All Rights Reserved
* This is unpublished proprietary source code of Ardent Software Inc.
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
*
*******************************************************************************
*
* Maintenence log - insert most recent change descriptions at top
*
* Date.... GTAR# WHO Description.........................................
* 10/13/98 23801 RGA Change copyright info.
* 08/10/95 17135 JC Added MAP argument for NLS.
* 07/02/90 6994 JWT integrate patch from ULTIMATE for syntax support
* 06/06/90 7077 JWT fix some typos
* 11/14/89 4743 KIS Print error if mode type greater than 3
* 07/27/88 5190 JSM Changed to get blocksiz from MT:Unit in &DEVICE&
* 07/25/88 - - Maintenence log purged at 5.2.1, see release 5.1.10.
*
*******************************************************************************
$OPTIONS DEFAULT
@SYSTEM.RETURN.CODE = -1
open "VOC" to f.VOC else
print 'Unable to open your VOC'
stop
end
open "&DEVICE&" to f.DEVICE else
print 'Unable to open the &DEVICE& file'
stop
end
dim line(9)
mat line = ""
matparse line from trim(@sentence) , " "
unit = -1; blocksiz = 'none'; mode = 0
mapname = ''
i = 2
scanlim = 8
* the following code was added to allow t.att to work like Ultimate
*
commapos = index(line(2),",",1)
if commapos # 0 then
line(9) = line(8)
line(8) = line(7)
line(7) = line(6)
line(6) = line(5)
line(5) = line(2)[commapos+1,999]
line(4) = "BLK"
line(3) = line(2)[1,commapos-1]
line(2)= "MTU"
scanlim += 3
end else
if inmat() = 2 and num(line(2)) then
line(3) = line(2)
line(2) = 'MTU'
end
end
loop
until line(i) = '' or i = scanlim do
read item from f.VOC,upcase(line(i)) then
if item<1>[1,1]='K' and item<2>=40 then line(i)='K_MTU'
if item<1>[1,1]='K' and item<2>=41 then line(i)='K_BLK'
if item<1>[1,1]='K' and item<2>=400 then line(i)='K_MAP'
end
begin case
case line(i)='K_MTU'
if unit # -1 then
print 'Keyword "MTU" previously specified'
stop
end
i+=1
if line(i) = '' then
print 'Missing MTU specifcation'
stop
end
if not(num(line(i))) then
print 'Illegal MTU specification "':line(i):'"'
stop
end
unit = mod(line(i),10)
if len(line(i)) = 3 then
mode = line(i)[1,1]
if mode > 3 then
print 'Mode value greater than 3--too large'
stop
end
end else
mode = 0
end
case line(i)='K_BLK'
if blocksiz # 'none' then
print 'Keyword "BLK" previously specified'
stop
end
i+=1
max = len(line(i))
if line(i)[1,1] = '(' then
line(i) = line(i)[2,max-1]
max-=1
end
if line(i)[max,1] = ')' then
line(i) = line(i)[1,max-1]
max-=1
end
if line(i) = '' then
print 'Missing tape block size specification'
stop
end
if not(num(line(i))) then
print 'Illegal tape block size specification "':line(i):'"'
stop
end
blocksiz = line(i)
case line(i)='K_MAP'
if mapname # '' then
print 'Keyword "MAP" previously specified'
stop
end
if NOT(SYSTEM(100)) then
print "Unable to set a mapname when NLS is not active"
stop
end
i+=1
max = len(line(i))
if line(i)[1,1] = '(' then
line(i) = line(i)[2,max-1]
max-=1
end
if line(i)[max,1] = ')' then
line(i) = line(i)[1,max-1]
max-=1
end
if line(i) = '' then
print 'Missing mapname specification'
stop
end
mapname = line(i)
case 1
if blocksiz # 'none' then
print 'Tape block size previously specified'
stop
end
max = len(line(i))
if line(i)[1,1] = '(' then
line(i) = line(i)[2,max-1]
max-=1
end
if line(i)[max,1] = ')' then
line(i) = line(i)[1,max-1]
max-=1
end
if line(i) = '' then
print 'Missing tape block size specification'
stop
end
if not(num(line(i))) then
print 'Illegal token "':line(i):'" on command line'
stop
end
blocksiz = line(i)
end case
i+=1
repeat
if unit = -1 then unit = 0
if blocksiz = 'none' then
read item from f.DEVICE,'MT':unit else
print "Unable to read &DEVICE& file entry for 'MT":unit:"'"
stop
end
blocksiz = item<3>
if blocksiz = '' then
read item from f.VOC,'T.ATT' else
print "Unable to read VOC entry for 'T.ATT'"
stop
end
blocksiz = item<5>
end
end
cmd="ASSIGN MT":unit:" TO MTU ":unit
if blocksiz # '' then cmd:=" BLK ":blocksiz
if mapname # '' then cmd:=" MAP ":mapname
chain cmd