Dave,
Providing that 'RTF_CCTL' is a one byte string variable, the two statements
can be combined to:
ECHO ___![ord(rtf_cctl)]!RTF_DATA
Some testing, looping 100 times, of the one vs two statement syntax, shows
an improvement of about 30% for the 'combined' statement.
Regards
Paul Christidis
HP-3000 Systems Discussion <[log in to unmask]> wrote on 04/26/2004
03:29:44 PM:
> Assuming that the variables have the correct values, and the following 2
> lines actually work, is it possible to combine them into one line, with
the
> ORD function inside the ECHO statement ? If so, would it run any
faster??
>
> SETVAR JUNK ORD(RTF_CCTL)
> ECHO ![___!JUNK]!RTF_DATA
>
> This is from my HP2RTF conversion routine, where for example, when the HP
> report wants a new page, 'RTF_CCTL' would be chr(49), ___49 would be
> '\page ' (the rtf code for new page), and RTF_DATA would be the first
line
> of the new page.
>
> It works as shown, and is WAAAY faster than the old code:
> IF RTF_CCTL = <a variable set to chr(49)>
> ECHO \page RTF_DATA
> ELSEIF <repeat for single-spacing, double-spacing, etc>...
> but I thought it might be a bit faster with one line instead of two, and
no
> 'JUNK' variable. This thing is still slower than I like, after every
tweak
> I can think of -- except actually (gasp!) switching to a compiled
language.
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|