Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- How to run a worksheet inside while loop

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-31-2017
05:17 AM

08-31-2017
05:17 AM

Hello everyone, I am new in programming with Mathcad Prime 4.0 and I am trying to found a solution to this problem.

I would like to make a while loop, in which a Mathcad worksheet is re-launched at each iteration.

To explain better: I have a worksheet (called ConvWorksheet) that compute a lot of stuff and in the end compute a convergence flag (1 if convergence is reached, 0 otherwise). I need to write an other worksheet that controls when ConvWorksheet has finally computed flag = 1. I tried with the "Include Worksheet" command inside the while loop, but I cannot insert it. Does anyone know how to do this? Thank you a lot!

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-31-2017
07:35 AM

08-31-2017
07:35 AM

Neither Mathcad nor Prime supports this kind of functionality, although the question has popped up several times over the past 20 years.

The best you can do is to assemble your calculations into a function (or more functions) so that you can call the function(s) in a while loop.

Success!

Luc

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

08-31-2017
07:35 AM

08-31-2017
07:35 AM

Neither Mathcad nor Prime supports this kind of functionality, although the question has popped up several times over the past 20 years.

The best you can do is to assemble your calculations into a function (or more functions) so that you can call the function(s) in a while loop.

Success!

Luc

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

09-01-2017
09:23 AM

09-01-2017
09:23 AM

Re: How to run a worksheet inside while loop

It's true that it was never supported, but it was possible to do it in MC11 using a scripted component. They broke that in MC12, but even then you could loop a worksheet using a second worksheet, also via a scripted component. Prime of course does not have scripted components, so such trickery is not possible.

Top Tags