parm lib='?'
parm token1='*none*',rtext1='',token2='*none*',rtext2='',token3='*none*',rtext3=''
parm token4='*none*',rtext4='',token5='*none*',rtext5='',token6='*none*',rtext6=''
if lft('!lib',1) = '?' then
setvar s chr(14)
setvar b chr(14)+':'+chr(15)
echo ![s+'R;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;']
echo ![b+' STDCOPY - PowerHouse USE command with text/token replacement.']
echo ![s+'5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;']
echo ![b+'']
echo ![b+' Syntax:']
echo ![b+' :STDCOPY lib [ [token1] [rtext1] ] ... []']
echo ![b+' use STDCIN']
echo ![b+'']
echo ![b+' Parameters:']
echo ![b+' lib Name of library file to be inserted.']
echo ![b+' token1 Token to be replaced by rtext1.']
echo ![b+' token2 Token to be replaced by rtext2.']
echo ![b+' token3 Token to be replaced by rtext3.']
echo ![b+' token4 Token to be replaced by rtext4.']
echo ![b+' token5 Token to be replaced by rtext5.']
echo ![b+' token6 Token to be replaced by rtext6.']
echo ![b+'']
echo ![b+' Restrictions:']
echo ![b+' Requires QUAD editor which is assumed to reside in PUB.SYS.']
echo ![b+'']
echo ![s+'F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;']
#
# Author: Robert W.Mills, (C) Clisby Computers, 2000
#
# Modification History can be found at the end of this file.
#
deletevar s, b
return
endif
#-- Validate input parameter values.
setvar stdcopy_lib ups('!lib')
setvar stdcopy_error 0
if not finfo('!lib.LIBRARY.SYSTEMS','exists') then
setvar stdcopy_error 1
endif
#-- Terminate if any errors were found.
if stdcopy_error <> 0 then
echo ; > stdcin
echo ;*** ERRORS in Standard Copy Procedure ************ >> stdcin
echo ; >> stdcin
echo ; Parameters specified : >> stdcin
echo ; >> stdcin
echo ; Library file . . : !stdcopy_lib >> stdcin
if '!token1' <> '*none*' then
echo ; Token 1 . . . . : !token1 >> stdcin
echo ; Replacement text : !rtext1 >> stdcin
endif
if '!token2' <> '*none*' then
echo ; Token 2 . . . . : !token2 >> stdcin
echo ; Replacement text : !rtext2 >> stdcin
endif
if '!token3' <> '*none*' then
echo ; Token 3 . . . . : !token3 >> stdcin
echo ; Replacement text : !rtext3 >> stdcin
endif
if '!token4' <> '*none*' then
echo ; Token 4 . . . . : !token4 >> stdcin
echo ; Replacement text : !rtext4 >> stdcin
endif
if '!token5' <> '*none*' then
echo ; Token 5 . . . . : !token5 >> stdcin
echo ; Replacement text : !rtext5 >> stdcin
endif
if '!token6' <> '*none*' then
echo ; Token 6 . . . . : !token6 >> stdcin
echo ; Replacement text : !rtext6 >> stdcin
endif
if stdcopy_error = 1 then
echo ; >> stdcin
echo ; Specified library file does not exist. >> stdcin
endif
echo ; >> stdcin
echo ;************************************************** >> stdcin
echo ; >> stdcin
deletevar stdcopy_@
return
endif
#-- Create command stream to perform required changes.
echo text stdcin > stdcopyc
if '!token1' <> '*none*' then
echo change |!token1|,|!rtext1|,all >> stdcopyc
endif
if '!token2' <> '*none*' then
echo change |!token2|,|!rtext2|,all >> stdcopyc
endif
if '!token3' <> '*none*' then
echo change |!token3|,|!rtext3|,all >> stdcopyc
endif
if '!token4' <> '*none*' then
echo change |!token4|,|!rtext4|,all >> stdcopyc
endif
if '!token5' <> '*none*' then
echo change |!token5|,|!rtext5|,all >> stdcopyc
endif
if '!token6' <> '*none*' then
echo change |!token6|,|!rtext6|,all >> stdcopyc
endif
echo add .001 by .001 >> stdcopyc
echo ;***** START OF COPY AND REPLACE CODE *************** >> stdcopyc
echo ; >> stdcopyc
echo ; Parameters specified : >> stdcopyc
echo ; >> stdcopyc
echo ; Library file . . : !stdcopy_lib >> stdcopyc
if '!token1' <> '*none*' then
echo ; Token 1 . . . . : !token1 >> stdcopyc
echo ; Replacement text : !rtext1 >> stdcopyc
endif
if '!token2' <> '*none*' then
echo ; Token 2 . . . . : !token2 >> stdcopyc
echo ; Replacement text : !rtext2 >> stdcopyc
endif
if '!token3' <> '*none*' then
echo ; Token 3 . . . . : !token3 >> stdcopyc
echo ; Replacement text : !rtext3 >> stdcopyc
endif
if '!token4' <> '*none*' then
echo ; Token 4 . . . . : !token4 >> stdcopyc
echo ; Replacement text : !rtext4 >> stdcopyc
endif
if '!token5' <> '*none*' then
echo ; Token 5 . . . . : !token5 >> stdcopyc
echo ; Replacement text : !rtext5 >> stdcopyc
endif
if '!token6' <> '*none*' then
echo ; Token 6 . . . . : !token6 >> stdcopyc
echo ; Replacement text : !rtext6 >> stdcopyc
endif
echo ; >> stdcopyc
echo ;---------------------------------------------------- >> stdcopyc
echo ; >> stdcopyc
echo // >> stdcopyc
echo list last >> stdcopyc
echo add >> stdcopyc
echo ; >> stdcopyc
echo ;***** END OF COPY AND REPLACE CODE ***************** >> stdcopyc
echo ; >> stdcopyc
echo // >> stdcopyc
echo keep >> stdcopyc
echo exit >> stdcopyc
#-- Create the stdcin file for use by PowerHouse.
purge stdcin,temp > $null
file stdcin;temp
copy !stdcopy_lib.LIBRARY.SYSTEMS,*stdcin
setjcw quadyes=1
setjcw quadreadonly=1
continue
run quad.pub.sys < stdcopyc > $null
#-- Tidy up.
setjcw quadyes=0
setjcw quadreadonly=0
deletevar stdcopy_@
return
#-- DO NOT ENTER EXECUTABLE CODE AFTER ABOVE 'RETURN' STATEMENT.
Modification History:
Versn | Date | Who | Reason for Change
------+------------+-----+------------------------------------------
01.00 | 17/02/2000 | RWM | Initial version.
01.01 | 15/05/2003 | RWM | Corrected error in display of help text.
#===================================================================
# End of command file.
#===================================================================
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|