The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

Programming Question
Message #1 Posted by Harington on 7 May 2004, 2:52 a.m.

how do you call a built in function? for example I want to use the function "sloveVx" in a program. Mode is RPN calculator is 49G+ Ex: << " Enter a """input obj-> " enter b """input obj-> ->a b << a b + solvevx>> >> input are : a->2x^2+3x=10 b->0 or integer

perhap vice versa: the outcome should be a sloultion to the equa if b =0 and a= 2x^2+3X=10 I'm not getting the correct solution need some help please

      
Re: Programming Question
Message #2 Posted by Vieira, Luiz C. on 7 May 2004, 6:57 p.m.,
in response to message #1 by Harington

Hello, Harington;

I'm not sure about what sort of result you're getting, but I'd guess a change in your program. Instead of:

 << " Enter a """input obj->    
    " enter b """input obj->
->a b 
 << a b + solvevx>>
     >>
try:
 << " Enter a """input str->    
    " enter b """input str->
->a b 
 << a b + solvevx>>
     >>

The [STR->] is an original HP28/HP48S command that removes the string delimiters ["] that may also be available in the HP49G+ (it is available in the HP48G series). I'm not sure it's gonna solve your problem, but it's worth a try. I'd guess the program evaluates your expression after [OBJ->] instead of simply getting it like an expression. Also, you may have a setting (mode flags) that cause the expression to be automaticaly evaluated after [OBJ->]. If so, changing this set might cause the program to work the way you need.

My assumptions are vague because I have no calcualtor neither any manuals in hands; I'm not home now, but I'd like to post these suggestions.

Sorry not helping the way I'd like to.

Luiz (Brazil)

Edited: 7 May 2004, 6:59 p.m.

            
Luiz (Brazil)
Message #3 Posted by Harrington on 8 May 2004, 4:33 p.m.,
in response to message #2 by Vieira, Luiz C.

do you know which flag that will be ? please post this for me it is taking me too long to figure the solution to this problem . I appreciate this Harrington(USA)

                  
It is not working (input is ex:2x+3=6)
Message #4 Posted by Harrington on 8 May 2004, 9:54 p.m.,
in response to message #3 by Harrington

The input to this problem should be any equa in firt and second oder EX 2x^2+3x=10 or 2x=10 I expect to see the correct sloution to these problem it is taking the input. slotion to these are wrong . that is where I have the problem the operating mode is PRN.

                        
Re: It is not working (input is ex:2x+3=6)
Message #5 Posted by Veli-Pekka Nousiainen on 8 May 2004, 10:24 p.m.,
in response to message #4 by Harrington

"The input to this problem should be any equa in firt and second oder EX 2x^2+3x=10 or 2x=10 I expect to see the correct sloution to these problem it is taking the input. slotion to these are wrong."

'2*X^2+3*X=10' SOLVEVX will work. Note that lower and UPPERCASE are different and that you need explicit multiply. {VPN} AXL

                              
This is what I get on stacks:1. {} 2. 3 and 3 2^x+2
Message #6 Posted by Harrington on 8 May 2004, 11:13 p.m.,
in response to message #5 by Veli-Pekka Nousiainen

Those are the ans I get when I use the input on stack 1 2 and on 3 for input 2X^2+3=10

on 1 it is just {} on 2 3=x on 3 2^x+2

wrong !!!

                                    
Re: This is what I get on stacks:1. {} 2. 3 and 3 2^x+2
Message #7 Posted by Vepa on 9 May 2004, 7:25 a.m.,
in response to message #6 by Harrington

I don't quite get what you want, 
but I give one more example anyway:
<< "Enter fn of " RCLVX + @ recall the current VX
"
Use =value to complete." +
{ "'" ALG V } @ start with tick in ALG mode and Verify
INPUT STR-> SOLVEVX >>

{VPN} AXL

                                          
Veli-Pekka, I am curious! (was: This is what I get...)
Message #8 Posted by Vieira, Luiz C. (Brazil) on 9 May 2004, 6:08 p.m.,
in response to message #7 by Vepa

Hello, Veli-Pekka;

I am curious about your previous post. I have an HP49G, not an HP49G+ (at least so far... 8^), and I saw you used a RCLVX in your last listings. Is it a new implemantation in the HP49G+? I read that the 49G+ O.S. can be used with earlier 94G models, but I didn't give them a try yet, so I don't know if RCLVX is something new (retrieve the expression last used with SOLVEVX ?).

Just that.

Thank you. And thatnk you also for posting a better answer for Harrington's question. I didn't take the "case" into account... q8^(

Luiz (Brazil)

                                                
Re: Veli-Pekka, I am curious! (was: This is what I get...)
Message #9 Posted by Veli-Pekka Nousiainen on 9 May 2004, 7:33 p.m.,
in response to message #8 by Vieira, Luiz C. (Brazil)

RCLVX and STOVX plus pretty print LIMIT as lim
are all found in the latest 1.9-6 ROM for the old 49G
No need to get the new 49g+
BUT
I still recommend it for the speed
For example switching between pplot modes is faster
CATalog is faster, booting your own STARTUP is faster
Naturally plotting is faster, too.
AND
Then the I/O via USB is 12*faster
plus you have an interface for a SD/MMC card.
The thing also eats up batteries faster...

Nowadays I only use the 49g+ (and the 33s) [VPN]

                                                      
Re: It is not working (input is ex:2x+3=6)
Message #10 Posted by Veli-Pekka Nousiainen on 9 May 2004, 7:39 p.m.,
in response to message #9 by Veli-Pekka Nousiainen

In case someone does not want to flash their 49G for the latest ROM you can always program the RCLVX command
Now depending on your ROM you may have either VX directly at HOME or in subdir called CASDIR
<< { HOME VX } RCL >> 'RCLVX' STO
<< { HOME CASDIR VX } RCL >> 'RCLVX' STO
<< PATH SWAP HOME 'VX' STO EVAL >> 'STOVX' STO
<< PATH SWAP HOME CASDIR 'VX' STO EVAL >> 'STOVX' STO
[VPN]
                                                      
Re: Veli-Pekka, I am curious! (was: This is what I get...)
Message #11 Posted by Vieira, Luiz C. (Brazil) on 9 May 2004, 7:43 p.m.,
in response to message #9 by Veli-Pekka Nousiainen

Hey, Veli-Pekka; thanks!

I'm waiting to put my hands in an HP49G+, and after what you wrote I see that I'll have a lot of new things to reason about... BTW: I updated my HP49G to the new(est?) 1.9-6, but I was not aware of these new features. Are they listed somewhere?

In fact, is there any e-doc about the new features since the original O.S. that first came with the HP49G? I saved all "New features list" in the HP site with all updated O.S. I downloaded, but the information is not so "explained", I mean, only a brief description of each new achievement. I don't remember them completely...

If you know (or anyone else knows) where to find it, I'd like to be "told" about... Please?

Tnanks a lot.

Luiz (Brazil)

Edited: 9 May 2004, 7:45 p.m.

                                                            
Re: It is not working (input is ex:2x+3=6)
Message #12 Posted by Veli-Pekka Nousiainen on 9 May 2004, 7:49 p.m.,
in response to message #11 by Vieira, Luiz C. (Brazil)

Sure there are - one that fits in a single double-sided sheet and another more detailed one in excel format:
http://www.hpcalc.org/details.php?id=3012
http://www.hpcalc.org/details.php?id=5265
I wonder who has gone through all that trouble...(-;
[VPN]
                                                                  
I see what you mean... Thank you! q8^) (NT)
Message #13 Posted by Vieira, Luiz C. (Brazil) on 9 May 2004, 10:34 p.m.,
in response to message #12 by Veli-Pekka Nousiainen

.

                        
Re: It is not working (input is ex:2x+3=6)
Message #14 Posted by Vieira, Luiz C. (Brazil) on 8 May 2004, 10:52 p.m.,
in response to message #4 by Harrington

Hi, Harington;

Please, follow Veli-Pekka very correct warning about upper case charactes. I see that your input string "Enter a" starts with an upper-case "E" and all of the rest of the program goes lower-case. Maybe you typed it correctly in your calculator, just a concern of mine.

Now, please, change your program so it looks like this one:

 << " Enter a " {"" ALG} INPUT "'" SWAP + OBJ->    
    " enter b " {"" ALG} INPUT "'" SWAP + OBJ->
    -> a b 
    << a b + SOLVEVX>>
 >>

The (not elegant) additional

 "'" SWAP +
will make sure that whatever you type in is converted to an equation prior to be stored. If you already typed the expression with a starting ', please remove this sequence. Also,
{"" ALG}
(instead of simply "") activates ALGebraic mode, that's helpfull when entering equations.

I ran it and the program finds the following roots:

{x = -(3+sqrt(89))/4  x = (-3+sqrt(89))/4
Is it what you expect? BTW, mine is an HP49G, not an HP49G+. I'm not sure this is relevant, but if it still does not work, let's try something else.

Let us know.

Success.

Luiz (Brazil)

Edited: 8 May 2004, 10:59 p.m.

                              
About flags (was: It is not working..)
Message #15 Posted by Vieira, Luiz C. (Brazil) on 8 May 2004, 11:11 p.m.,
in response to message #14 by Vieira, Luiz C. (Brazil)

Hi, Harington;

I forgot to mention that two flags MAY alter the resulting data format:

flag -3 -> if set, numeric results; if clear, symbolic results

Flag -105 -> if clear, Exact Mode is set and if there are no exact results a null list is returnned.

Hope that's all.

Luiz (Brazil)

                                    
All flags are set (no solution yet )
Message #16 Posted by Harrington on 8 May 2004, 11:41 p.m.,
in response to message #15 by Vieira, Luiz C. (Brazil)

lol hp is cool calculator I means it is powerful but sometimes things goes wrong with these mechine. it i s not working as suppose any suggestion

            
Re: Programming Question
Message #17 Posted by Veli-Pekka Nousiainen on 8 May 2004, 5:59 p.m.,
in response to message #2 by Vieira, Luiz C.

<< " Enter a """input obj->    
    " enter b """input obj->
->a b 
 << a b + solvevx>>
     >>
================================
try: 
 << " Enter a " "" INPUT OBJ-> @ note the BIG LETTERS    
    " enter b " "" INPUT OBJ-> @ CAPITAL LETTERS
-> a b              @ note the blank between -> and a b 
 << a b + SOLVEVX >> @ 
>>

{VPN} AXL

                  
Finally got this working
Message #18 Posted by Harrington on 8 May 2004, 11:48 p.m.,
in response to message #17 by Veli-Pekka Nousiainen

yes it was a very small typo that you and VPN stressed "E" caps wow I watc out for these now I guess


[ Return to Index | Top of Index ]

Go back to the main exhibit hall