[Info-vax] capture program output into a symbol ?

Pierre pierre.bru at gmail.com
Fri May 13 05:31:10 EDT 2011


On May 10, 1:37 am, Hein RMS van den Heuvel
<heinvandenheu... at gmail.com> wrote:
> 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.

I looked a BC source to add a verb (ie export) that would give the
opportunity to "export" a variable back to DCL. I looked at the
"print" function but it outputs text char by char, not via any kind of
string buffer :-/

> Pierre,
>
> Is it a hard requirement to use 'bc', perhaps to reuse prior work?
> Or will any floating point package do?

any package would do the trick. exporting result to DCL would be a
plus.

> 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

wouldn't perl be just a too big hammer for such a small nail ? how big
is perl.exe ?

> $ 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...




More information about the Info-vax mailing list