[Info-vax] capture program output into a symbol ?
Hein RMS van den Heuvel
heinvandenheuvel at gmail.com
Mon May 9 19:37:52 EDT 2011
On Apr 18, 11:58 am, David Mathog <dmat... at gmail.com> wrote:
> On Apr 18, 5:11 am, Pierre <pierre.... at gmail.com> wrote:
>
> > hi,
>
> > I use BC to do floating point calculation in DCL. for ex:
> > [http://antinode.info/dec/sw/bc.html]
:
> and one of the modifications was that the first 10 results were
> automatically stored in a symbol ICALC_OUT so that DCL could get at
> them.
Might want to re-port 'bc' to do just that.
Pierre,
Is it a hard requirement to use 'bc', perhaps to reuse prior work?
Or will any floating point package do?
If the latter, consider icalcV as David suggests:
- http://decuslib.com/Freeware/freewarev80/icalcv/
- http://www.digiater.com/openvms/freeware/v80/icalcv/
Or in a pinch PERL will do the job
$ perl -e "$ENV{RESULT} = sprintf qq(%.7f), 1/7"
$ show symb result
%DCL-W-UNDSYM, undefined symbol - check validity and spelling
$ show log result
"RESULT" = "0.1428571" (LNM$PROCESS_TABLE)
$
$ define PERL_ENV_TABLES CLISYM_LOCAL
$ perl -e "$ENV{RESULT} = sprintf qq(%.7f), 100/81"
$ show symb result
RESULT = "1.2345679"
fwiw,
Hein
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1408424
More information about the Info-vax
mailing list