cancel
Showing results for 
Search instead for 
Did you mean: 
  • ×
    Information
    Fix Windows 10 Update Issues

    Resolve Windows 10 or update issues on HP computer or printer– Click Here

  • post a message
  • ×
    Information
    Fix Windows 10 Update Issues

    Resolve Windows 10 or update issues on HP computer or printer– Click Here

  • post a message
Highlighted
Level 1
11 7 0 0
Message 1 of 1
222
Flag Post

How to really branch in a HP Prime calculator program?

HP Recommended
HP Prime calculator

I know how to use "IF THEN ELSE", in the HP Prime calculator, to test whether a condition, such as a>b, is true, and then execute some command entered just after the " THEN", such as multiplying c by 4, if the condition is true, and executing some different command entered just after the "ELSE", such as multiplying c by 3, if it is false, but I don't know how to do branching to other, maybe far distant, parts of the program depending on whether it is true or false. The latter is the main type of branching available and used in most programming languages, such as FORTRAN (an old but still used language) and even the HP 42 calculator programming language. This latter type of branching is much more flexible than the Prime type, which can only branch to the commands that are specially entered into the area of the "IF THEN ELSE". Is there some way of doing the more flexible type of branching in the Prime? If there were a way in the Prime to identify program lines by, say, line number N, and there were a "GO TO N" command to enter after the "THEN" and/or "ELSE" in the Prime, that would do it, but there doesn't seem to be either of these.

Be alert for scammers posting fake support phone numbers on the community. If you think you have received a fake HP Support message, please report it to us by clicking on "Flag Post".
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation