A new version of my HP2RTF rich-text-format converter is (finally) ready. Let
me know if anyone wants it.
The main differences are:
It is MUCH faster (depending on how you rig the tests, between 3 and 330 times
faster, and I do mean TIMES, not percent).
Fixed some problems with characters like ">" in the input file.
The first time you run it, it creates a cobol program on your system, which is
how it gets the performance increase. Anyone without a cobol compiler will
need to make other arrangements to get the program, like asking me to email
it, or translating the cobol source into some other language (its not really a
very hairy program).
The magic trick to have a command file extract part of itself and compile it
is:
setvar RTF_PROG_NAME "yourprog.group.account"
file RTFPROG = !RTF_PROG_NAME, OLD
if not finfo ("*RTFPROG", "exists")
echo Need to do the 1st-time-only build of the cobol pgm
file x = tempfile; temp
setvar RTF_1 "--" + "1" + "--"
run editor.pub.sys;info='t !hpfile;setformat=cobol;&
fq "!RTF_1";dq first/*+0;g all;k *x;e'
deletevar RTF_1
echo Done creating Cobol source temp file, about to compile
file COBTEXT = tempfile
file COBOBJ = $NEWPASS
file COBLIST; dev=lp,1
file COBCNTL.PUB.SYS = $NULL
run cobol.pub.sys; parm=5
link from=$oldpass; to=!RTF_PROG_NAME
endif
This works if you have the cobol source at the end of the command-file, and
have "--1--" on the last line before it. Grep might work better for other
files, but Editor with "setformat=cobol" is good for Cobol line numbers. If
you want to compile twice in one session without problems, add the following
near the beginning:
file tempold = tempfile, oldtemp
if finfo ("*tempold", "exists")
purge *tempold
endif
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|