HP 50g simple programming

I have a HP 50g calculator, just want to wirte some simple program,

like input R, the program calculates the circle area; input L, H, W,

then the program can calculate the surface area, ect. I read the user

menu, but feel too complicated, before I had a HP 42s, the user menu

showed the detailed programming steps, but it was broken. Who is

familiar with 50g programming and can show me a couple of simple

program, I would so appreciate.

Re: HP 50g simple programming

Well, the 42s is programmed in RPN, the 50G in UserRPL. That's a big

difference.

Get yourself the HP 49G+ Advanced User's Reference Manual (AUR) in pdf

for download.

Programming in UserRPL can still be very simple:

Having value for height, width and length on the stack, you can use this

program to have the resulting volume on stack level 1:

<< -> H W L << H W L * *>> >>

<< >> being keyed in by [Right Shift] [+]

and

-> by [Right Shift][0]

Have fun!

GeorgeBailey

Re: HP 50g simple programming

"George Bailey" <bailey.20.ala1ala@xoxy.net> wrote in message

news:gdus4g$t4g$1@online.de...[color=blue]

> Well, the 42s is programmed in RPN, the 50G in UserRPL. That's a big

> difference.

>

> Get yourself the HP 49G+ Advanced User's Reference Manual (AUR) in pdf for

> download.

>

> Programming in UserRPL can still be very simple:

>

> Having value for height, width and length on the stack, you can use this

> program to have the resulting volume on stack level 1:

>

> << -> H W L << H W L * *>> >>[/color]

or just << * * >>

inputting r and getting 2 pi r

<< 2 * pi * ->NUM @ ensure symbolic pi is numeric[color=blue][color=green]

>>[/color][/color]

pi is [Left-Shift] [SPC]

[color=blue]

> << >> being keyed in by [Right Shift] [+]

> and

> -> by [Right Shift][0]

>

> Have fun!

>

> GeorgeBailey[/color]

Re: HP 50g simple programming

Veli-Pekka Nousiainen schrieb:[color=blue]

> or just << * * >>[/color]

I seriously question the need for a program in this case ;-)

By the way, you can download the AUR from hpcalc.org at

[url]http://www.hpcalc.org/hp49/docs/misc/hp49gpaur.zip[/url]

with many programming examples.

Cheers,

George

Re: HP 50g simple programming

On Oct 24, 7:46*pm, kx...@hotmail.com wrote:[color=blue]

> I have a HP 50g calculator, just want to wirte some simple program,

> like input R, the program calculates the circle area; *input L, H, W,

> then the program can calculate the surface area, ect. *I read the user

> menu, but feel too complicated, before I had a HP 42s, the user menu

> showed the detailed programming steps, but it was broken. Who is

> familiar with 50g programming and can show me a couple of simple

> program, I would so appreciate.[/color]

Calculate area of circle:

area = pi * r^2

On HP 50:

<<

SQ 3.14159265359 *

"Area" ->TAG[color=blue][color=green]

>>[/color][/color]

Store the program in a

variable named AREA:

1. Open program delimiters

with rt. shift << >>. Look

above the [+] key.

2. Type in the program.

3. Press [ENTER] to place

program on the stack.

4. Press the [ ' O] key. It

is the key with MTRW EQW

above it.

5. Type in AREA then [ENTER].

6. Press the [STO] key to

store the program.

7. To use the program enter

a number in stack level one

and then press the soft key

below the menu label AREA.

Example:

Input: 1: 5.00

Output: 1: Area:78.54

8. Go to [CONST] in the

MTH menu and then [3.14]

to get pi.

9. Enter 2 FIX to display

two places after the

decimal point.

10. I'm using an hp 49g+

so if any keys are different

from your hp 50 I apologize

in advance.

Re: HP 50g simple programming

On Oct 25, 2:46 am, kx...@hotmail.com wrote:[color=blue]

> I have a HP 50g calculator, just want to wirte some simple program,

> like input R, the program calculates the circle area; input L, H, W,

> then the program can calculate the surface area, ect. I read the user

> menu, but feel too complicated, before I had a HP 42s, the user menu

> showed the detailed programming steps, but it was broken. Who is

> familiar with 50g programming and can show me a couple of simple

> program, I would so appreciate.[/color]

Welcome. There are several different ways to accomplish this. In the

programs below, \-> is the RightShift 0 character.

If you want to enter L, H, and W on the stack and have the program

calculate the surface area of a rectangular box, the simplest approach

would be to define a function:

\<< \-> L H W '2*(L*W+L*H+H*W)' \>>

Or coming from a 42s, you might prefer a stack manipulation program:

\<< 3. DUPN * UNROT * + UNROT * + 2 * \>>

If you want the program to prompt the user for input, you could do

something like:

\<<

"Enter Length" "" INPUT STR\->

"Enter Height" "" INPUT STR\->

"Enter Width" "" INPUT STR\->

\-> L H W '2*(L*W+L*H+H*W)'

\>>

And finally if you want a form to fill in with tagged output:

\<<

"Surface Area of Box"

{ "Length:" "Height:" " Width:" }

{ 1. 0. }

{ 1 1 1 }

DUP

INFORM

IF

THEN

OBJ\-> DROP

\-> L H W '2*(L*W+L*H+H*W)'

END

"Area"

\->TAG

\>>

Hope this points you in the right direction.

-wes

Re: HP 50g simple programming

On Oct 24, 7:46*pm, kx...@hotmail.com wrote:[color=blue]

> I have a HP 50g calculator, just want to wirte some simple program,

> like input R, the program calculates the circle area; *input L, H, W,

> then the program can calculate the surface area, ect. *I read the user

> menu, but feel too complicated, before I had a HP 42s, the user menu

> showed the detailed programming steps, but it was broken. Who is

> familiar with 50g programming and can show me a couple of simple

> program, I would so appreciate.[/color]

EQNLIB (libraries 226 and 227) came with the calculator. For your

problems, use Plane Geometry and Solid Geometry. Enter in the known

values and the tell the calculator which variable to solve for.

Otherwise, read Chapter 21 on the 50g User's Guide (the PDF) for

information about UserRPL programming.

S.C.

Re: HP 50g simple programming

Simple example program for area of a circle:

<< Pi SWAP 2 ^ * EVAL>> ENTER

AREA STO

(There you store your program into AREA variable)

Then just put R on the stack and press the corresponding softkey to

execute the AREA program.

Another way:

<< -> R 'Pi*R^2' EVAL>> ENTER

ENTER

Again, just put R on the stack and press the corresponding softkey to

execute the AREA program.

Re: HP 50g simple programming

On Oct 24, 7:46*pm, kx...@hotmail.com wrote:[color=blue]

> I have a HP 50g calculator, just want to wirte some simple program,

> like input R, the program calculates the circle area; *input L, H, W,

> then the program can calculate the surface area, ect. *I read the user

> menu, but feel too complicated, before I had a HP 42s, the user menu

> showed the detailed programming steps, but it was broken. Who is

> familiar with 50g programming and can show me a couple of simple

> program, I would so appreciate.[/color]

Greetings,

Calculate area of circle:

area = pi * r^2

On the HP 50:

<<

SQ 3.14159265359 *

"Area" ->TAG[color=blue][color=green]

>>[/color][/color]

Store the program in a

variable named AREA:

1. Open program delimiters

with rt. shift << >>. Look

above the [+] key.

2. Type in the program.

3. Press [ENTER] to place

program on the stack.

4. Press the [ ' O] key. It

is the key with MTRW EQW

above it.

5. Type in AREA then [ENTER].

6. Press the [STO] key to

store the program.

7. To use the program enter

a number in stack level one

and then press the soft key

below the menu label AREA.

Example:

Input: 1: 5.00

Output: 1: Area:78.54

8. Go to [CONST] in the

MTH menu and then [3.14]

to get pi.

9. Enter 2 FIX to display

two places after the

decimal point.

10. I'm using an hp 49g+

so if any keys are different

from your hp 50 I apologize

in advance.

Calculate surface area

of rectangular prism:

2*L*W + 2*L*H + 2*W*H

<<

3 DUPN * 2 * @ Face A

5 ROLLD * 2 * @ Face B

4 ROLLD * 2 * @ Face C

+ + "Area" ->TAG @ Area[color=blue][color=green]

>>[/color][/color]

Note: @ begins a comment and

is not part of the program.

It is for documentation only.

Example:

Input: 3: 22 @ Length

2: 16 @ Width

1: 11 @ Height

Output: 1: Area:1,540.00

Regards,

Mark

Re: HP 50g simple programming

On Fri, 24 Oct 2008 18:46:26 -0500:

[color=blue]

> I have a HP 50g calculator, just want to write some simple program,

> like input R, the program calculates the circle area;

> input L, H, W, then the program can calculate the surface area, etc.[/color]

All things representable by formulas can be calculated directly

using the numeric solver (just as on the HP42S),

and you can save a set of your own equations,

then choose any one to solve (for any variable,

not just calculating one particular variable from the others);

for example, in RPN mode:

'A=\pi*R^2' 'CIRCA' STO

'A=(L*H+H*W+W*L)*2' 'BOXA' STO

\<< "Choose formula" 9 TVARS 1 CHOOSE

{ STEQ 30 MENU } IFT \>> 'MYEQS' STO

The 'MYEQS' program chooses any formula in the current directory,

then starts the menu-based solver (like that of the HP42S).

You can also just start the form-based numeric solver

(Right-shift NUM.SLV "Solve Equation")

and choose an equation using the form,

rather than using a program.

A slight expansion of the 'MYEQS' program could permit

navigating through a directory tree,

as well as picking equations from a single directory.

Solving equations like this

will store additional variables named in the formulas,

containing numeric data;

when you no longer need to save any such variables,

you can purge them all from the current directory,

plus any left-over "current equation(s)" and solver data using:

\<< { 0 28 } TVARS { EQ Mpar } + PURGE \>> 'PGEQ' STO

Numeric values with attached "units" (e.g. 3.2_cm)

may be included in this "clean-up"

by expanding the list of object types to { 0 13 28 }

All of the above works in all HP48G/49G/50G series.

[r->] [OFF]

Re: HP 50g simple programming

On Oct 24, 7:46*pm, kx...@hotmail.com wrote:[color=blue]

> I have a HP 50g calculator, just want to wirte some simple program,

> like input R, the program calculates the circle area; *input L, H, W,

> then the program can calculate the surface area, ect. *I read the user

> menu, but feel too complicated, before I had a HP 42s, the user menu

> showed the detailed programming steps, but it was broken. Who is

> familiar with 50g programming and can show me a couple of simple

> program, I would so appreciate.[/color]

Greetings,

Calculate area of circle:

area = pi * r^2

On the HP 50:

<<

SQ 3.14159265359 *

"Area" ->TAG[color=blue][color=green]

>>[/color][/color]

Store the program in a

variable named AREA:

1. Open program delimiters

with rt. shift << >>. Look

above the [+] key.

2. Type in the program.

3. Press [ENTER] to place

program on the stack.

4. Press the [ ' O] key. It

is the key with MTRW EQW

above it.

5. Type in AREA then [ENTER].

6. Press the [STO] key to

store the program.

7. To use the program enter

a number in stack level one

and then press the soft key

below the menu label AREA.

Example:

Input: 1: 5.00

Output: 1: Area:78.54

8. Go to [CONST] in the

MTH menu and then [3.14]

to get pi.

9. Enter 2 FIX to display

two places after the

decimal point.

Note: I'm using an hp 49g+

so if any keys are different

from your hp 50 I apologize

in advance.

Calculate surface area

of rectangular prism:

2*L*W + 2*L*H + 2*W*H

<<

3 DUPN * 2 * @ Face A

5 ROLLD * 2 * @ Face B

4 ROLLD * 2 * @ Face C

+ + "Area" ->TAG @ Area[color=blue][color=green]

>>[/color][/color]

Note: @ begins a comment and

is not part of the program.

It is for documentation only.

Example:

Input: 3: 22 @ Length

2: 16 @ Width

1: 11 @ Height

Output: 1: Area:1,540.00

Regards,

Mark

Re: HP 50g simple programming

On Oct 25, 2:46 am, kx...@hotmail.com wrote:[color=blue]

> I have a HP 50g calculator, just want to wirte some simple program,

> like input R, the program calculates the circle area; input L, H, W,

> then the program can calculate the surface area, ect. I read the user

> menu, but feel too complicated, before I had a HP 42s, the user menu

> showed the detailed programming steps, but it was broken. Who is

> familiar with 50g programming and can show me a couple of simple

> program, I would so appreciate.[/color]

Welcome. There are several different ways to accomplish this.

If you want to enter L, H, and W on the stack and have the program

calculate the surface area of a rectangular box, the simplest approach

would be to define a function:

\<< \-> L H W '2*(L*W+L*H+H*W)' \>>

where \<< and \>> are the program brackets, RightShift +, and \-> is

RightShift 0.

Or coming from a 42s, you might prefer a stack manipulation program:

\<< 3. DUPN * UNROT * + UNROT * + 2 * \>>

If you want the program to prompt the user for input, you could do

something like:

\<<

"Enter Length" "" INPUT STR\->

"Enter Height" "" INPUT STR\->

"Enter Width" "" INPUT STR\->

\-> L H W '2*(L*W+L*H+H*W)'

\>>

And finally if you want a form to fill in with tagged output:

\<<

"Surface Area of Box"

{ "Length:" "Height:" " Width:" }

{ 1. 0. }

{ 1 1 1 }

DUP

INFORM

IF

THEN

OBJ\-> DROP

\-> L H W '2*(L*W+L*H+H*W)'

"Area"

\->TAG

END

\>>

Hope this points you in the right direction.

-wes

Re: HP 50g simple programming

On Oct 25, 10:46*am, kx...@hotmail.com wrote:[color=blue]

> I have a HP 50g calculator, just want to wirte some simple program,

> like input R, the program calculates the circle area; *input L, H, W,

> then the program can calculate the surface area, ect. *I read the user

> menu, but feel too complicated, before I had a HP 42s, the user menu

> showed the detailed programming steps, but it was broken. Who is

> familiar with 50g programming and can show me a couple of simple

> program, I would so appreciate.[/color]

Try that:

« "SURFACE AREA OF BOX:" DUP

{ ":L:

:H:

:W: " { 1. 5. } V } INPUT

CLLCD 7. FREEZE

SWAP 1. DISP DUP 3. DISP

OBJ-> 3. DUPN * UNROT * + UNROT * + 2. * ":A: " OVER + 7. DISP

»

Cheers,

Reth

Re: HP 50g simple programming

On Oct 26, 6:44*pm, Wes <wjltemp...@yahoo.com> wrote:[color=blue]

> On Oct 25, 2:46 am, kx...@hotmail.com wrote:

>[color=green]

> > I have a HP 50g calculator, just want to wirte some simple program,

> > like input R, the program calculates the circle area; *input L, H, W,

> > then the program can calculate the surface area, ect. *I read the user

> > menu, but feel too complicated, before I had a HP 42s, the user menu

> > showed the detailed programming steps, but it was broken. Who is

> > familiar with 50g programming and can show me a couple of simple

> > program, I would so appreciate.[/color]

>

> Welcome. *There are several different ways to accomplish this.

>

> If you want to enter L, H, and W on the stack and have the program

> calculate the surface area of a rectangular box, the simplest approach

> would be to define a function:

>

> \<< \-> L H W '2*(L*W+L*H+H*W)' \>>

>

> where \<< and \>> are the program brackets, RightShift +, and \-> is

> RightShift 0.

>

> Or coming from a 42s, you might prefer a stack manipulation program:

>

> \<< 3. DUPN * UNROT * + UNROT * + 2 * \>>

>

> If you want the program to prompt the user for input, you could do

> something like:

>

> \<<

> * "Enter Length" "" INPUT STR\->

> * "Enter Height" "" INPUT STR\->

> * "Enter Width" "" INPUT STR\->

> * \-> L H W '2*(L*W+L*H+H*W)'

> \>>

>

> And finally if you want a form to fill in with tagged output:

>

> \<<

> * "Surface Area of Box"

> * { "Length:" "Height:" " Width:" }

> * { 1. 0. }

> * { 1 1 1 }

> * DUP

> * INFORM

> * IF

> * THEN

> * * OBJ\-> DROP

> * * \-> L H W '2*(L*W+L*H+H*W)'

> * * "Area"

> * * \->TAG

> * END

> \>>

>

> Hope this points you in the right direction.

>

> -wes[/color]

Or try this:

\<< "SURFACE AREA OF BOX:" DUP { ":L:

:H:

:W: " { 1. 5. } V } INPUT CLLCD 7. FREEZE SWAP 1. DISP DUP 3. DISP OBJ-[color=blue]

> 3. DUPN * UNROT * + UNROT * + 2. * ":A: " OVER + 7. DISP[/color]

\>>

reth

Re: HP 50g simple programming

On Oct 25, 1:10*pm, "John H Meyers" <jhmey...@nomail.invalid> wrote:[color=blue]

> On Fri, 24 Oct 2008 18:46:26 -0500:

>[color=green]

> > I have a HP 50g calculator, just want to write some simple program,

> > like input R, the program calculates the circle area;

> > input L, H, W, then the program can calculate the surface area, etc.[/color]

>

> All things representable by formulas can be calculated directly

> using the numeric solver (just as on the HP42S),

> and you can save a set of your own equations,

> then choose any one to solve (for any variable,

> not just calculating one particular variable from the others);

> for example, in RPN mode:

>

> 'A=\pi*R^2' 'CIRCA' STO

>

> 'A=(L*H+H*W+W*L)*2' 'BOXA' STO

>

> \<< "Choose formula" 9 TVARS 1 CHOOSE

> * { STEQ 30 MENU } IFT \>> 'MYEQS' STO

>

> The 'MYEQS' program chooses any formula in the current directory,

> then starts the menu-based solver (like that of the HP42S).

>

> You can also just start the form-based numeric solver

> (Right-shift NUM.SLV "Solve Equation")

> and choose an equation using the form,

> rather than using a program.

>

> A slight expansion of the 'MYEQS' program could permit

> navigating through a directory tree,

> as well as picking equations from a single directory.

>

> Solving equations like this

> will store additional variables named in the formulas,

> containing numeric data;

> when you no longer need to save any such variables,

> you can purge them all from the current directory,

> plus any left-over "current equation(s)" and solver data using:

>

> \<< { 0 28 } TVARS { EQ Mpar } + PURGE \>> 'PGEQ' STO

>

> Numeric values with attached "units" (e.g. 3.2_cm)

> may be included in this "clean-up"

> by expanding the list of object types to { 0 13 28 }

>

> All of the above works in all HP48G/49G/50G series.

>

> [r->] [OFF][/color]

what's these ' \ ' slashes in the codes mean ? I cna't find in the 50G

user guide.

example:

\<< "Choose formula" 9 TVARS 1 CHOOSE

{ STEQ 30 MENU } IFT \>> 'MYEQS' STO

\<< { 0 28 } TVARS { EQ Mpar } + PURGE \>> 'PGEQ' STO

Re: HP 50g simple programming

cut and paste to notepad save and transfer it your calc

Trigraphs represent calculator special characters

<kxbao@hotmail.com> wrote in message

news:4ab3be02-10f1-42ee-95d1-25cb5556021f@z6g2000pre.googlegroups.com..

what's these ' \ ' slashes in the codes mean ? I cna't find in the 50G

user guide.

example:

\<< "Choose formula" 9 TVARS 1 CHOOSE

{ STEQ 30 MENU } IFT \>> 'MYEQS' STO

\<< { 0 28 } TVARS { EQ Mpar } + PURGE \>> 'PGEQ' STO

Re: HP 50g simple programming

In article

<4ab3be02-10f1-42ee-95d1-25cb5556021f@z6g2000pre.googlegroups.com>,

[email]kxbao@hotmail.com[/email] wrote:

[color=blue]

> what's these ' \ ' slashes in the codes mean ? I cna't find in the 50G

> user guide.

> example:

>

> \<< "Choose formula" 9 TVARS 1 CHOOSE

> { STEQ 30 MENU } IFT \>> 'MYEQS' STO

>

> \<< { 0 28 } TVARS { EQ Mpar } + PURGE \>> 'PGEQ' STO[/color]

They mark that what follows represents a special character which does

not appear in the ASCII alphabet.

"\<<" and "\>>" represent the symbols which look like "<<" and ">>" on

the hp50, and mark the beginning end ending of a program.

Re: HP 50g simple programming [backslashes]

On Sun, 02 Nov 2008 20:34:43 -0600:

[color=blue]

> what's these '\' backslashes [e.g. \<< \>> ] in the codes mean?

> I can't find in the 50G user guide.[/color]

To represent 8-bit characters which have no universal symbols,

so as to appear the same to everyone using all text editors, browsers,

newsgroup readers, email, and to the calculator itself

(when using Kermit or other text file transfer software),

as well as being able to type the programs on all computer keyboards.

Complete explanation and chart at:

[url]http://groups.google.com/group/comp.sys.hp48/msg/52e9cc3ee2b369b8[/url]

Import/export programs for emulators such as Emu48:

[url]http://groups.google.com/group/comp.sys.hp48/msg/4e7ed90b3cf11c42[/url]

[r->] [OFF]

Re: HP 50g simple programming [backslashes]

[color=blue]

> Import/export programs for emulators such as Emu48:

> [url]http://groups.google.com/group/comp.sys.hp48/msg/4e7ed90b3cf11c42[/url][/color]

The above also imports and exports

between calculators and plain text files on SD cards

(which in turn may be stored or edited using computers).

[r->] [OFF]

Re: HP 50g simple programming [backslashes]

On Nov 3, 1:39 pm, "John H Meyers" <jhmey...@nomail.invalid> wrote:[color=blue][color=green]

> > Import/export programs for emulators such as Emu48:

> >[url]http://groups.google.com/group/comp.sys.hp48/msg/4e7ed90b3cf11c42[/url][/color]

>

> The above also imports and exports

> between calculators and plain text files on SD cards

> (which in turn may be stored or edited using computers).

>

> [r->] [OFF][/color]

On 50g user's guide page 679:

"Units coefficient" { { "S.I. units" 1}

{ "E.S. units" 1.486} } 1 CHOOSE >> --->„³ save to 'CHP1'

Running this program, system will highlight choose box 'S.I

Units' (1st choice)

If I select 'S.I. Units' result is s2 1

S1 1

If I select 'E.S. Units' result is s2 1.486

S1 1

I made a small change in this program,

"Units coefficient" { { "S.I. units" 1}

{ "E.S. units" 1.486} } 2 CHOOSE >> --->„³ save to 'CHP1'

Running this program, system will highlight choose box 'E.S

Units' (2nd choice)

If I select 'S.I. Units' result is s2 1

S1 1

If I select 'E.S. Units' result is s2 1.486

S1 1

It seems to me : the corresponding coefficient of the system unit

selected is put on stack 2 (s2)

But why in the two examples, the stack 1 (s1) always show number '1' ,

this confuse me..???