The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP Prime print terminal
Message #1 Posted by CD Dodds on 28 Nov 2013, 12:11 p.m.

I created a program which calculates elevations at intervals along a vertical curve. The data is returned using the print command. The data quite often scrolls off the top of the screen. According to the calculators help on print you should be able to arrow up and down through the data. This doesn't seem to work, I can push the data off the top of the screen using the touch screen but can't retrieve the data that scrolled off the the screen when the program ran. Am I expecting something that this is not intended for? I am used to RPN and using the stack for data storage. Any insight would be appreciated.

      
Re: HP Prime print terminal
Message #2 Posted by cyrille de Brébisson on 29 Nov 2013, 3:25 a.m.,
in response to message #1 by CD Dodds

hello,

in prime, you would place all your data in a list and return the list at the end. you can then look at the list in the list editor (either by program doing an editlist, or by forcing the list in L1 or something like that, or by returning it and letting the user do a L1:=myProg type command line).

note that if you do l(0):=value, value gets ADDED at the end of the list!

cyrille

            
Re: HP Prime print terminal
Message #3 Posted by CD Dodds on 1 Dec 2013, 4:57 p.m.,
in response to message #2 by cyrille de Brébisson

Thanks, that worked nicely. Now I'm trying to get my stationing to look like stationing. I'm just using real numbers now ie "3025.42", but I would like it to display like "30+25.42".

cat((format(IP((STA/100)),"f0","+",format((FP(STA/100))*100),"f2");

Where STA is a variable containing a real number. I tried just the IP and FP parts but wind up with four decimal places in the station format since my settings are fix 4. Ie "30.000+25.4200". I have had a hard time getting the format command to work. Works for "30+"then errors out. Thinking I need figure out how to change the number of decimals displayed during that line in the program and forget the format command.

                  
Re: HP Prime print terminal
Message #4 Posted by cyrille de Brébisson on 2 Dec 2013, 1:30 a.m.,
in response to message #3 by CD Dodds

hello,

temporary change the display setting to normal local t:= HFormat; HFormat:= 0; local s:= string(IP(real/100))+"+"+string(real MOD 100); HFormat:= t;

should work to get your "ab+cd.ef" in s...

cyrille

                        
Re: HP Prime print terminal
Message #5 Posted by CD Dodds on 6 Dec 2013, 10:25 p.m.,
in response to message #4 by cyrille de Brébisson

Hi

I decided to abandon using interger part and fraction part and just deal with it as a string.

STA1() BEGIN STA:=STRING(xt); //xt is real number (station) WHILE DIM(STA)<6 DO STA:="0"+STA //adds a 0 in front, gives 0+25 instead of +25 END;

STA:=ROTATE(STA,-HDigits-3);

STA:=STA+"+";

STA:=ROTATE(STA,HDigits+3);

END;

everything works good except I still get odd output between -0+99.99 and 0. Should be easy enough to fix. just need some time to think about it when I'm not worn to a frazzel. thanks again for your help.

Chad

Edited: 6 Dec 2013, 10:26 p.m.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall