Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Having been a MathCad user for more than a decade, I recently upgraded to MathCad Prime 2.0 (which I really like). To "get acquainted", I started with the included Tutorial.
The Programming Tutorial, Task 2-2: Writing If-Else If Statements, contains numerous references in the Practice section to "alsoif" (which, of course, should be "elseif"). I have no idea how to report such a bug to PTC, so I'm posting it here. If there is a way to send Bug Reports of this nature in directly to PTC, I'd be happy to learn about it (and will certainly utilize it if/when I find more bugs).
Robert Schor wrote:
Having been a MathCad user for more than a decade, I recently upgraded to MathCad Prime 2.0 (which I really like). To "get acquainted", I started with the included Tutorial.
The Programming Tutorial, Task 2-2: Writing If-Else If Statements, contains numerous references in the Practice section to "alsoif" (which, of course, should be "elseif"). I have no idea how to report such a bug to PTC, so I'm posting it here. If there is a way to send Bug Reports of this nature in directly to PTC, I'd be happy to learn about it (and will certainly utilize it if/when I find more bugs).
It's not a bug. 'alsoif' is a legitimate conditional statement that allows a user to refine a true conditional. The Tutorial shows its use. An example might be something along the lines of ...
if gender = "M" then
str = "male"
also if age > 50 then
str = "overweight, out-of-breath, harrassed "
also if age > 70 then
str = "wizened old " & str
elseif gender = "F"
str = "young lady"
endif
(note there is no alsoif statement for gender = "F" otherwise age = age + 1 will suffer a slight existence problem)
Stuart
Eek! Note to self: never, ever, rely on memory to tell you how things you never use behave!
Forget the above example, alsoif will evaluate the condition regardless of whether the preceding if or alsoif statements were true.
Robert,
We added both elseif and alsoif for compatibility with earlier versions of Mathcad. Alsoif is like a series of if statements.
From Help,
When you use elseif, the program stops evaluating statements when it reaches the first true statement.
When you use alsoif, the program evaluates all alsoif statements. If any of them are true, the program does not evaluate any of the following else statements.
Mona
Humble Pie. I never noticed Also If (and have never used it, obviously). Still, in the context of the referenced Tutorial, having just talked about Else If, it is a little "jarring" to suddenly start mentioning Also If, as if (only a small play-on-words intended) it were something familiar to the (first-time) reader. Better would be to either stick with Else If (for consistency) or to say something like "Else If (or the related Also If) ...".