it took quite a while before I found out the Mathcad 15 may have a big bug with if - otherwhise...
After introducing an one line statement using if, the next standard line holding an if-otherwise construct was not executed if the first condition was true. This happened two times in the code!
I have to say that this akward behavior makes it more likely to stay away from ptc as much as possible...
two minutes after- the whole software crashed...
You have to be lucky if storing is possible or some GDI or memory error occurs preventing from saving your work
It's really terrible and I do not understand why PTC does not underatke anything to correct the bugs in this software!
It is clear that everybody has tested trivial examples. I guess in my case the problem might be the trace statement. So my problem looks like this
trace("xy") if VV = true
The whole if otherwise block is skipped!
I have identified the same problem in various programms now! Some sort of worst case scenario if you cannot rely on software integrity!
It is clear that everybody has tested trivial examples.
Trivial? We offered solutions as no example was presented in the first place.
Can you not provide a Mathcad worksheet?
It's not a bug. You just misunderstand how a sequence of if statements work. If there are no other lines in the program between if and otherwise statements they are taken as one logical block. This is necessary, to be able to handle multiple possible cases, with a final "otherwise" to catch any cases that are not explicitly handled. Note the difference:
You are not the first person to be confused by this. The way the program is written is rather ambiguous, and relies on the reader to know what this structure will do. It would be preferable if it were obvious to the casual reader. That is exactly why the syntax in Prime was changed. In Prime you have "if", "else if" "also if" and "else" statements, so there is no confusion about what the program will do.