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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

continue

ValeryOchkov
24-Ruby IV

continue

I have only one Mathcad-sheet with ORIGIN not 0 or 1

See ORIGIN - PTC Community

I have only one Mathcad-sheet with continue programming operator. I can show it!

But we can creat this program without the continue operator. But with the continue operator it is nice, fine, прикольно!

Do you have or do you seen a Mathcad-sheet with continue priogramming operator?

continue.png

7 REPLIES 7
LucMeekes
23-Emerald III
(To:ValeryOchkov)

This is the new programming palet for Prime 8:

LucMeekes_0-1637604946996.png

😉

 

Luc

My own programming palet for Prime (fuzzy sets)

continue-1.png

I think it is one in the over the World Mathcad program with the continue operator - and we can delete it!

2a-MySort-Continue.png

LucMeekes
23-Emerald III
(To:ValeryOchkov)

What is purpose of the assignment to n (the first statement of the program)?

The program runs with the same result, but faster, without the continue statement.

And it can be speeded up a little more by integrating the assignment to Flag into the vector assignment:

LucMeekes_2-1638721627315.png

Success!

Luc

 

Yes! I would like to see one program where we need to use the continue operator!

3-MySort-Short.png


@ValeryOchkov wrote:

Yes! I would like to see one program where we need to use the continue operator!

 


You could as well ask for a program where we NEED to use a for-loop!
Having different kind of loops (while, for and in other programming languages also do..while) is a convenience, nothing more. As long as a programming language offers one type of loop (and a conditional branch) or recursion, you can always emulate the other kind of loops (with more or less effort). The same applies to "continue". Sometimes it may be convenient to have it available, but you can always find a way to accomplish the same with other means, too.

 

BTW, the program you posted in your last reply is missing the initialisation of variable "Flag" to zero. You can never know if there isn't a global variable "Flag" defined in the worksheet with a value different from zero. Your example shows that it would be nice to have the third kind of loop in Prime (do...while, repeat...until) available, but, alas, Prime does not offer it and so we have to find a way around using the loops which Prime offers.

Yes! we need only while loop! Not if, for, etc

Announcements

Top Tags