HP Forums

Full Version: Switch statement on cas mode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does anyone have an idea of how to compose switch statements on CAS programs? There's this from the giac documentation, but it does not seem to work since the brackets syntax for blocks is not a thing on the prime version.
(10-03-2020 01:34 AM)fakuivan Wrote: [ -> ]Does anyone have an idea of how to compose switch statements on CAS programs? There's this from the giac documentation, but it does not seem to work since the brackets syntax for blocks is not a thing on the prime version.
Since SWITCH isn't even in the catalog, I use a string of

IF
...
ELSEIF
...
ELSEIF
...
ELSE
...
END

statements
switch, case and default are reserved words on CAS (try to assign a value to them). There are many functions that are not in the catalogue but are still accessible. I'm hoping here someone with the code for the calculator in hand can tell me if it's possible to get it working. I'm aware of the alternatives like early returns or concatenated if statements.
Reference URL's