HP Forums

Full Version: Prime: Anyway to refresh stack?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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.

Hello,

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

cyrille

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

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

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.

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!