Post Reply 
Adding Table of constant Units? how?
09-10-2016, 08:22 AM (This post was last modified: 09-10-2016 01:13 PM by StephenG1CMZ.)
Post: #9
RE: Adding Table of constant Units? how?
(09-09-2016 06:12 PM)tom234 Wrote:  
(09-04-2016 06:50 PM)StephenG1CMZ Wrote:  If you need your constants to include units rather than just numbers, there is a complication: CONVERT's second parameter must be 1 unit, not 0.5 unit (using 0.5 in this example to convert between HP AU and my own AU, to make the output value obviously different.

Code:


 EXPORT MYAU:=0.5;//MULTIPLIER TO CONVERT BETWEEN HP AU AND MY AU
 EXPORT MYAUinAU:=0.5*1_au;//DOESNT WORK
 EXPORT LY()
 BEGIN
  PRINT();
  PRINT("LYR in HP AU: "+CONVERT(1_lyr,1_au));
  PRINT("LYR in MY AU: "+MYAU*CONVERT(1_lyr,1_au));
  PRINT("LYR NOT in my AU: "+CONVERT(1_lyr,MYAUinAU));//users may not expect this
 END;


To make Using your own units possible you would want CONVERT to notice that MYAUinAU was a value other than 1 unit and modify the number returned accordingly.

///////////////////
with all due respect to all the programmers C++, Perl, Ruby are a lot easier and more powerful a language than HP C. its making me second guess just using an app on my iPhone to do this calculator thing.
Is there a code or language PDF for HP C(language)????????

The language users use to program on the HP Prime is called PPL (Prime Programming Language).. Some have referred to it as being like Pascal.
www://http://support.hp.com/us-en/product/HP-Prime-Graphing-Calculator/5367459/model/5367460/manuals
The most up to date guide to syntax will be that in the on-calculator help.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Adding Table of constant Units? how? - StephenG1CMZ - 09-10-2016 08:22 AM



User(s) browsing this thread: 4 Guest(s)