cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

for-while loop control with break, continue

Ninetrees
12-Amethyst

for-while loop control with break, continue

As I mentioned in another thread, I don't have extensive experience with Mathcad programming, but I thought a few simple examples would illustrate my points about the use of 'break' and 'continue'. I recognize that we all have our own styles, so I welcome other examples and discussion.

Rich
http://www.downeastengineering.com/
4 REPLIES 4

Note that while the file is saved in MC11 format, not everything in it works in MC11.
__________________
� � � � Tom Gutman

I don't have M11 (I skipped a few versions and picked it up again w M12), though I have looked on and off for a used version. That is why I have begun to put a note in documents that I save as M11, so that others will know what version I used to save it. I wish that those of use who own more recent versions of Mathcad could get earlier versions for free. (Mona, any chances?) I'd love to have M11 to test stuff in before I post.

As for the comment in XX(1530).MCD re using a loop or just range variables, the intent of the examples is to show how I've seen folks use the continue and break statements, and to show an alternative programming style that I think is safer and easier to read.

OTOH, for some reason, I had completely missed that feature of matrix() that you used later in the document, and I find it a very useful example, especially considering the implicit lambda function. Thanks for the example.

Rich
http://www.downeastengineering.com/

On 10/18/2009 9:50:11 AM, woodwise wrote:
>As I mentioned in another
>thread, I don't have extensive
>experience with Mathcad
>programming, but I thought a
>few simple examples would
>illustrate my points about the
>use of 'break' and 'continue'.
>I recognize that we all have
>our own styles, so I welcome
>other examples and discussion.
>
>Rich
>http://www.downeastengineering
>.com/
_______________________________

+ examples would mean endless discussions. The best way to apply the Mathcad programming structure is to draw a logigramme. Real applications don't have much choice except the right one. If you visit this collab regularly, plenty of good programming modules.

jmG



If you're going to try to use the matrix function in MC11 you really ought to read the documentation for that function. The function that you pass to it must be a function of two arguments, not a function of one argument as you wrote.
__________________
� � � � Tom Gutman
Announcements

Top Tags