# Banal output problem (User RPL) - Hewlett Packard

This is a discussion on Banal output problem (User RPL) - Hewlett Packard ; Hello to all, It banal but not for a beginner I desire output on the stack: level 3 the calculus result level 2 input 2 level 1 input 1 But for level 1 and 2 I obtain only the name ...

# Thread: Banal output problem (User RPL)

1. ## Banal output problem (User RPL)

Hello to all,
It banal but not for a beginner
I desire output on the stack:
level 3 the calculus result
level 2 input 2
level 1 input 1

But for level 1 and 2 I obtain only the name of the variable!

\<< CLEAR "Enter M n:" { "
:M:
:n:" { 2. 0. } V } INPUT OBJ\-> \-> M n
'M*n*2.*\pi/60./1000.' \->NUM "P[kW]" \->TAG
M "M[Nm]" \->TAG
n "n[rpm]" \->TAG
\>>

Someone can give me a hint?

2. ## Re: Banal output problem (User RPL)

guilippo@vtxmail.ch wrote:
> Hello to all,
> It banal but not for a beginner
> I desire output on the stack:
> level 3 the calculus result
> level 2 input 2
> level 1 input 1
>
> But for level 1 and 2 I obtain only the name of the variable!
>
> \<< CLEAR "Enter M n:" { "
> :M:
> :n:" { 2. 0. } V } INPUT OBJ\-> \-> M n
> 'M*n*2.*\pi/60./1000.' \->NUM "P[kW]" \->TAG
> M "M[Nm]" \->TAG
> n "n[rpm]" \->TAG
> \>>
>
> Someone can give me a hint?

Your \-> M n construct looks wrong. Is it like this in the program or is
it just a typo in your posting?

Should be something like:

\<< CLEAR "Enter M n:" { "
:M:
:n:" { 2. 0. } V } INPUT OBJ\-> \-> M n \<<
'M*n*2.*\pi/60./1000.' \->NUM "P[kW]" \->TAG
M "M[Nm]" \->TAG
n "n[rpm]" \->TAG
\>> \>>

Regards,
--
Bruce Horrocks
Surrey
England
(bruce at scorecrow dot com)

3. ## Re: Banal output problem (User RPL)

On Mar 14, 2:37*pm, Bruce Horrocks <07....@scorecrow.com> wrote:
> guili...@vtxmail.ch wrote:
> > Hello to all,
> > It banal but not for a beginner
> > I desire output on the stack:
> > level 3 the calculus result
> > level 2 input 2
> > level 1 input 1

>
> > But for level 1 and 2 I obtain only the name of the variable!

>
> > \<< CLEAR "Enter M n:" { "
> > :M:
> > :n:" { 2. 0. } V } INPUT OBJ\-> \-> M n
> > 'M*n*2.*\pi/60./1000.' \->NUM "P[kW]" \->TAG
> > M "M[Nm]" \->TAG
> > n "n[rpm]" \->TAG
> > \>>

>
> > Someone can give me a hint?

>
> Your \-> M n construct looks wrong. Is it like this in the program or is
> it just a typo in your posting?
>
> Should be something like:
>
> \<< CLEAR "Enter M n:" { "
> :M:
> :n:" { 2. 0. } V } INPUT OBJ\-> \-> M n \<<
> 'M*n*2.*\pi/60./1000.' \->NUM "P[kW]" \->TAG
> M "M[Nm]" \->TAG
> n "n[rpm]" \->TAG
> \>> \>>
>
> Regards,
> --
> Bruce Horrocks
> Surrey
> England
> (bruce at scorecrow dot com)- Hide quoted text -
>
> - Show quoted text -

Yes it is so.
Regards, guilippo

4. ## Re: Banal output problem (User RPL)

On Mar 14, 5:15 pm, guili...@vtxmail.ch wrote:
> On Mar 14, 2:37 pm, Bruce Horrocks <07....@scorecrow.com> wrote:
> > guili...@vtxmail.ch wrote:
> > > \<< CLEAR "Enter M n:" { "
> > > :M:
> > > :n:" { 2. 0. } V } INPUT OBJ\-> \-> M n
> > > 'M*n*2.*\pi/60./1000.' \->NUM "P[kW]" \->TAG
> > > M "M[Nm]" \->TAG
> > > n "n[rpm]" \->TAG
> > > \>>

> >
> > Your \-> M n construct looks wrong. Is it like this in the program or is
> > it just a typo in your posting?
> >
> > Should be something like:
> >
> > \<< CLEAR "Enter M n:" { "
> > :M:
> > :n:" { 2. 0. } V } INPUT OBJ\-> \-> M n \<<
> > 'M*n*2.*\pi/60./1000.' \->NUM "P[kW]" \->TAG
> > M "M[Nm]" \->TAG
> > n "n[rpm]" \->TAG
> > \>> \>>

>
> Yes it is so.

In your program, M and n are local variables only within the algebraic
expression that produces stack level 3. In the rest of the program,
they are global variable names.

In Bruce's program, the additional \<< and \>> extend the scope of the
local variables to the words that produce stack levels 1 and 2.

Your program is buggy. Bruce's version is correct.

Cheers.