-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
-
×InformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center. -
- HP Community
- Archived Topics
- Unanswered Topics - Others
- How to really branch in a HP Prime calculator program?

Create an account on the HP Community to personalize your profile and ask a question

05-26-2020 06:30 AM - edited 05-26-2020 07:07 AM
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.
