I am trying to include Mathcad files where I use a variable as a part of the file name. i.e. when I change the variable, the name of the included file changes. I want this for Mathcad 15 and Mathcad prime.
Solved! Go to Solution.
It is not supported, not in Mathcad, not in Prime.
Thanks for your reply.
Can the include commands be a part of "if" statement where a file is included only if a condition is satisfied?
Neither, as far as I know.
You can bring your ideas here: https://community.ptc.com/t5/PTC-Mathcad-Ideas/idb-p/PTCMathcadIdeas
Is it possible to create/modify an Include region via the API?
You could do as shown in the following image:
What was the reason you chose the nested if-otherwise structure instead of, say, a vector?
I made it in 2018 and I published it in this community some time ago. So I thought that a click was enough, in your file, however, "there is no click". In my worksheet, there is still another if-otherwise nested structure for the actual launch of the chosen function by clicking on the corresponding button. I like your solution, it simplifies many things, however, I think you will find problems with the launch of functions that present, in addition to the independent variable, also parameters in number varying from function to function. See the following image:
This can be done also simply with:
If you consistently use the return for each result, you don't need any otherwise. That is due to the fact that return makes the program stop there.
But you can also put all strings in a single array, and return the element with the proper index:
As Stuart has shown.
My approach to the problem is as basic as possible. If I think about it better, maybe my memory of C ++ influenced me a lot.