The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Prime: Anyway to refresh stack?
Message #1 Posted by kris223 on 10 Oct 2013, 3:19 p.m.

I have made a program that will change the "Base" variable that I have assigned to the Sin key. It does the job and changes the system base, but I must go to another app or open Settings and close it again to force an update of the stack. Once this happens, all the #Numbers update to the new base. I have tried various things to try and update the stack via my program, but can't find anything so far that works. Any ideas?

KEY K_SIN()
BEGIN
CHOOSE(B, "Base", "Bin", "Oct", "Dec", "Hex");
Base:=B-1;

RETURN 1; END;

I have tried things like a messagebox and startview ... all I can remember at the moment, but I've been beating on it and I'll bet there is a solution :)

By returning a 1 it seems to always fall back to the "Solve Symbolic View" and then I hit the Home key and it works. But if I could call a refresh to the stack or Home or something in the program that might eliminate this step. As this all is about the same key strokes as simply changing it via the Settings, it's kind of pointless at the moment. I'm trying to find a quick way to do this and it may seem trivial to some but say one is doing Quine-McCluskey Minimization's, its nice to easily find out the number of ones in a decimal number oer and over (or write another program) or many other digital electronic thingies require quickly bouncing between bases. Thanks in advance.

      
Re: Prime: Anyway to refresh stack?
Message #2 Posted by cyrille de Brébisson on 11 Oct 2013, 1:25 a.m.,
in response to message #1 by kris223

Hello,

did you try adding STARTVIEW(-2); STARTVIEW(-1); at the end of your program?

cyrille

            
Re: Prime: Anyway to refresh stack?
Message #3 Posted by kris223 on 11 Oct 2013, 8:54 a.m.,
in response to message #2 by cyrille de Brébisson

Thanks for the response. It doesn't work. Tried with and without the return statement.

                  
Re: Prime: Anyway to refresh stack?
Message #4 Posted by Marcus von Cube, Germany on 11 Oct 2013, 9:27 a.m.,
in response to message #3 by kris223

What about STARTVIEW(-1,1); ? The second argument should force a redraw.

                        
Re: Prime: Anyway to refresh stack?
Message #5 Posted by kris223 on 11 Oct 2013, 1:35 p.m.,
in response to message #4 by Marcus von Cube, Germany

Thanks again. I did try that and it didn't work. I went through the help files list of views and tried to for redraws on many of them to see what would happen. Lesson learned is don't force a redraw of the View window as I had to reboot the device as I couldn't figure out how to get rid of it after that LOL.

                        
Re: Prime: Anyway to refresh stack?
Message #6 Posted by kris223 on 16 Oct 2013, 5:09 p.m.,
in response to message #4 by Marcus von Cube, Germany

OK,I got it and I'm very pleased! The trick is to start another view to switch from Home view and then have the program go back to the Home view. It works seamless and the user never sees it.

KEY K_SIN()
BEGIN
CHOOSE(B, "Base", "Bin", "Oct", "Dec", "Hex");
Base:=B-1;
STARTVIEW(6, 1);
STARTVIEW(-1, 1);
END;

For anyone reading this that may need more explicit directions:

1)Enter the numbers with the default base: ALPHA->#->myNumber
2)Press SHIFT->User->SIN to change the base

The stack updates all "#"'s with the new default base. Much like the 48G and this makes my day. Thanks for all the help and brain squishing!


[ Return to Index | Top of Index ]

Go back to the main exhibit hall