home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of A1200
/
World_Of_A1200.iso
/
programs
/
text
/
golded
/
data
/
tools
/
hispeed
/
arexx
/
join.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-02-27
|
2KB
|
84 lines
/* Join jobs together. Useful to save some paper */
options results
shell
address HISPEED.1
SET REQUESTER ON
QUERY JOBS
JOBS = RESULT
if JOBS < 2 then
SET WARN "At least two jobs (files) required !"
else
do
SET ASK "This macro will join your files together, creating|a file T:DOCUMENT. The files will be separated by|form feed codes. Proceed ?"
if RESULT = 1 then
do
COMMAND = 'JOIN '
do N = 0 to JOBS-1
QUERY JOBNAME N
parse var RESULT PATH NAME REST
TEMP = 'T:' || NAME
if OPEN('HEAD', 'T:HEADER', 'WRITE') = FALSE then
SET WARN "Couldn't open temporary header file !"
else
if OPEN('HEAD', 'T:HEADER', 'WRITE') = FALSE then
SET WARN "Couldn't open temporary header file !"
else do
if (N ~= 0) then
do
R = WRITELN('HEAD', '' )
R = WRITELN('HEAD', '' )
R = WRITECH('HEAD', '') /* form feed */
end
R = WRITELN('HEAD', CENTER(COPIES('*', 60), 70))
R = WRITELN('HEAD', CENTER(('*' || COPIES(' ', 58) || '*'), 70))
R = WRITELN('HEAD', CENTER(('*' || CENTER('File: ' || PATH || NAME, 58) || '*'), 70))
R = WRITELN('HEAD', CENTER(('*' || COPIES(' ', 58) || '*'), 70))
R = WRITELN('HEAD', CENTER(COPIES('*', 60), 70))
R = WRITELN('HEAD', '')
R = WRITELN('HEAD', '')
R = WRITELN('HEAD', '')
R = CLOSE('HEAD')
shell
JOIN '>NIL: T:HEADER "' || PATH || NAME || '" AS ' || TEMP
address HISPEED.1
COMMAND = COMMAND || TEMP || ' '
end
end
shell
COMMAND || 'AS T:DOCUMENT'
address HISPEED.1
SET PERFORMFF
CLR
SET FILE 'T:DOCUMENT'
end
end