Need to convert FIF49 to Prime version
|
06-16-2018, 02:23 PM
Post: #1
|
|||
|
|||
Need to convert FIF49 to Prime version
Hi, I am an old 48GX user who's 48 is dying so I have purchased a new HP Prime. I have never done any programming but frequently use a program called FIF49 located on HPCALC.org It is a program that adds measurements in feet inches and fractions together in a RPN calculator. I don't believe it runs on the Prime but I was wondering if anyone here could help me get it converted. I am hoping that you might be able to look at the program and see if you could possibly convert it to run on the Prime. It would be a great help.
I will eventually learn the Prime programming but this is something I need for work so I don't have the luxury of time. I am hoping it is a simple conversion. FIF49 |
|||
06-18-2018, 12:51 PM
(This post was last modified: 06-18-2018 12:55 PM by Eddie W. Shore.)
Post: #2
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
For the HP 48/49 experts: what is # 181057d SYSEVAL? Thanks.
I can see if I can get something similar, I have flirted with programming with feet-inches programming, except that the numbers are in ff.ii (feet - inches) format and I use functions specific functions to add and multiply such numbers. Eddie |
|||
06-18-2018, 02:16 PM
Post: #3
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
(06-18-2018 12:51 PM)Eddie W. Shore Wrote: For the HP 48/49 experts: what is # 181057d SYSEVAL? Thanks.Thank you Eddie |
|||
06-18-2018, 03:27 PM
Post: #4
|
|||
|
|||
RE: Need to convert FIF49 to Prime version | |||
06-18-2018, 03:29 PM
(This post was last modified: 06-18-2018 03:30 PM by Joe Horn.)
Post: #5
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
(06-18-2018 12:51 PM)Eddie W. Shore Wrote: For the HP 48/49 experts: what is # 181057d SYSEVAL? Thanks. That's the entry point for the ?DispStack command in the 50g. HP 48S/SX/G/GX: #39B85h SYSEVAL --> ?DispStack HP 50g: #2C341h SYSEVAL --> ?DispStack Donnelly's Gray Book describes it thus: "If no keys are in the keybuffer, draws the stack area, otherwise does not draw the stack area and executes SetDA2aBad." EDIT: Oops, grsbanks beat me to it. <0|ɸ|0> -Joe- |
|||
06-18-2018, 03:42 PM
Post: #6
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
(06-18-2018 12:51 PM)Eddie W. Shore Wrote: what is # 181057d SYSEVAL? Thanks. Here's the descriptions for the SYSEVAL references I saw in the source: #181057d SYSEVAL: ?DispStack Redisplays the stack immediately during a running program if necessary #155601d SYSEVAL: DISPROW7 Displays a string on row 7 of the display #192145d SYSEVAL: SetDA2Valid Sets the disposition of display area DA2 as valid (similar to FREEZE for that part of the display) #192103d SYSEVAL: SetDA1Valid Sets the disposition of display area DA1 as valid (similar to FREEZE for that part of the display) #180985d SYSEVAL: DispStsBound Displays a horizontal line at y=14, normally the separation between header and stack |
|||
06-21-2018, 12:35 PM
(This post was last modified: 06-21-2018 07:47 PM by Eddie W. Shore.)
Post: #7
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
I have a program in process that does work with feet-inches, I adopted it to use the structure of the Prime.
Here is what I have: The program FTIN has the user select the accuracy (1/2 to 1/64). You enter units through a menu (feet, inches, fractions or square feet). The operations available: Add and subtract feet-inches Multiply and divide by a scalar Multiply feet-inches to a square feet area (rounded to the nearest 6 decimal places) Divide an area by a length Find a diagonal of a square area Code:
Thanks for the explanation of the SYSEVAL commands. Eddie **I made a correction in the division by scalar section. The above code is now correct. |
|||
06-21-2018, 01:03 PM
(This post was last modified: 06-21-2018 01:22 PM by Mikebike.)
Post: #8
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
Eddie, thank you for your work. I will be putting the software that came with the Prime on my PC at home and then adding this code to a new app and give it a go.
Spent most of the first few days with the Prime getting used to the layout and the CAS aspects of it. I really like this HP Prime and it seems to be an excellent model to move up to from my older calculator. Is the CONN4X program what I need to use to transfer this code onto my Prime? |
|||
06-21-2018, 07:49 PM
Post: #9
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
(06-21-2018 01:03 PM)Mikebike Wrote: Eddie, thank you for your work. I will be putting the software that came with the Prime on my PC at home and then adding this code to a new app and give it a go. Thank you, much appreciated. For HP Prime, you will need to use the Connectivity Kit. The kit can be found on this thread: http://www.hpmuseum.org/forum/thread-10219.html |
|||
06-22-2018, 01:58 AM
(This post was last modified: 06-22-2018 01:59 AM by Mikebike.)
Post: #10
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
I got the Connectivity kit and made a new program and posted in your code but I may have pasted it in there incorrectly. It gave me a syntax error. I think I pasted it in and left some commands that need to be taken out. The code I have is this...
1BEGIN 2sub1(); 3sub2(); 4 5 6EXPORT FTIN() 7BEGIN 8// 2018-06-21 EWS 9 10// initialization 11LOCAL fx,fy,fz,ch; 12LOCAL lx,ly,lz,Y,S; 13LOCAL aflag,str,dh; All the rest of the code and then At the End I have 221f:=IP(x); 222i:=IP(FP(x)*12); 223s:=ROUND(FP(FP(x)*12)*y,0); 224t:=QPI(s/y); 225RETURN {f,i,t}; 226END; 227 What dod I need to delete or change? |
|||
06-22-2018, 06:39 AM
Post: #11
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
Take out the line numbers. They are not needed.
|
|||
06-22-2018, 07:02 AM
Post: #12
|
|||
|
|||
RE: Need to convert FIF49 to Prime version | |||
06-22-2018, 10:57 AM
Post: #13
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
1. Create a new program in the connectivity kit called FTIN.
2. In the new program's ENTRY box, select EVERYTHING and delete it. 3. Re-visit Eddie's code block in his posting. SELECT all of his code, COPY it and then PASTE it into the connectivity kit program entry box. 4. Select the Save, or the Save All Icon (The 3.5" disc in the connectivity kit's menu bar) to save it to the emulator, or other connected devices -OR- DRAG the program's name from the left calculator pane, and DROP it on any other connected calculator. The program should be usable at this point. If it doesn't run, use [Shift] [Programs], find the FTIN program, and click on it. Select the soft menu [Check], where issues can be identified. Creating programs will become familiar and quite useful with practice. |
|||
06-22-2018, 12:19 PM
(This post was last modified: 06-22-2018 12:27 PM by Mikebike.)
Post: #14
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
That worked. I did what you said and the program works. I will be using it and getting used to how it operates.
I will be looking at the code to learn from it and see how it all works. Eddie, thanks for putting that together so quickly!!! One question, on the Prime, is it possible to customize the soft keys that are on the screen or are these "owned" by the operating system and non customizeable even in your own program? |
|||
06-22-2018, 01:07 PM
Post: #15
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
It is possible to customize soft keys. This is done through the DRAWMENU command and use the MOUSE keys.
On the link here I have two programs that uses soft menus: https://edspi31415.blogspot.com/2014/04/...grams.html Also here is an updated FTIN: I corrected a spelling error and re-labeled on the of the options. . Code:
|
|||
06-22-2018, 04:44 PM
Post: #16
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
Programs similar to Eddie's FTIN and FIF49, require a lot of steps to get through a related problem, such as this one, taken from the provided examples in FIF49:
A 15' 9-1/2" wall is to have three 14-5/8" windows installed equally spaced. What is the horizontal space between the windows? To solve the problem you multiply the window width times three, subtract the total window width from the wall length, and divide the space remaining by four. Press L1: FIF Remarks FIF, FIF2 - - Opens FIF environment 15, FT or ENTER 15.00 15' 0" Wall width feet 9, IN 15.75 15' 9" Adds inches 1, /2 15.79 15' 9" 1/2 Adds halves 0, FT 0.00 0' 0" Assumes FIX 2 mode 14, IN 1.17 1' 2" L1: Must have a number 5, /8 1.22 1' 2" 5/8 Adds 5/8 inches 3, X 3.66 3' 7" 7/8 Width of 3 windows - 12.14 12' 1" 5/8 Wall minus windows 4, ö 3.03 3' 0" 7/16 Space between windows It's easier to enter the terms of this problem directly into the hp prime command line: (15_(ft)+(9+(1/2))_(inch)-(3*(14+(5/8))_(inch)))/4; // ==> 3.03385416668_(ft); FP(CAS.left(3.03385416668_(ft))) * 12; // to extract the fractional inches... Multiply by the architectural fraction desired, to get the fractional inch measure, (round accordingly): ROUND(FP(CAS.left(3.03385416668_(ft))) * 12 * 16,0); // For sixteenths ==> 3' 7/16" So, just entering the terms of the problem, (with appropriate units), is actually easier than using the program ... not to mention creating the program in the first place! -Dale- |
|||
06-24-2018, 01:37 PM
Post: #17
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
There is an alternate approach which is to use 3 element lists to represent feet, inches and fractions of inches.
For example, the 15' 9-1/2" wall from earlier is entered as {15,9,1/2} (which displays as {15,9,0.5} but pressing [a b/c] turns the 0.5 back to a fraction). Addition, subtraction and multiplication by a constant work as expected e.g. '3 * {0,14,5/8}' gives {0,42,1.875} which then just needs to be 'normalised'. The function FIF does this normalisation: Code: EXPORT FIF(m) The full windows-in-wall example can be calculated as: ({15,9,1/2}-3*{0,14,5/8})/4 -> {3.75,-8.25,-0.34375} and then FIF(Ans) -> {3, 0, 13/32} It is an easy matter to modify the code to use fixed 8ths or 16ths for the third value in the list if so desired. |
|||
06-24-2018, 03:38 PM
(This post was last modified: 06-24-2018 04:03 PM by DrD.)
Post: #18
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
Thats cool!
You might like to keep the units and fraction format: Code:
Shortened version: Code:
[attachment=6027] -Dale- |
|||
06-24-2018, 04:41 PM
Post: #19
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
7.00/16.00 = 13.00/32.00 ???
|
|||
06-24-2018, 06:31 PM
Post: #20
|
|||
|
|||
RE: Need to convert FIF49 to Prime version
(06-24-2018 04:41 PM)Didier Lachieze Wrote: 7.00/16.00 = 13.00/32.00 ??? excuses := { To the nearest architectural fraction, Take or leave the cut line?, Offset for pencil thickness?, Coefficient of expansion?, Delta temperature?, Machine tolerance?, Blade tolerance?, It looks better than 6+1/2/16 = 13/32?, It looks better than 6.5/16 = 13/32?, Rounding effect, }; Choose one, or more ... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)