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

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Error PRIME 10: This function accepts at most 18 arguments but is applied to 19

TNO-HTH
4-Participant

Error PRIME 10: This function accepts at most 18 arguments but is applied to 19

When running a Mathcad file in PRIME10 created in PRIME 9, I get an error:

“This function accepts at most 18 arguments but is applied to 19”

This restriction was not present in Mathcad 15 and earlier versions of PRIME.

 

TNOHTH_0-1718701240348.png

How to solve this?

 

added: 
Thanks for your reactions. The problem can be solved with future developments.

However, what about the existing MC sheets with locked areas with passwords where changes are not possible? This means these worksheets are unusable . Without an update from the author/owner of the sheet, this remains a serious problem. I would call it a bug, and Mathcad users should be warned about this problem before updating. In my opinion, the limit should be changed in a service pack P10.

9 REPLIES 9

Use subscripted variables:

 

Sums.png

 

Alan


@TNO-HTH wrote:

When running a Mathcad file in PRIME10 created in PRIME 9, I get an error:

“This function accepts at most 18 arguments but is applied to 19”

This restriction was not present in Mathcad 15 and earlier versions of PRIME.


I can confirm that you found yet another a new bug in Prime 10.

Functions defined for more than 18 arguments don't work!

Feel free to go through the hassle and report it to PTC support.

 

Werner_E_0-1718711937478.png

The attached file is in Prime 9 version where the bug does not yet occur, so if you open the sheet in Prime 10, you have to recalculate the sheet to see the difference and the error occurring.

 

A workaround, as Alan already suggested, is to use a vector with all 19 or more arguments as the only function argument.  If you need more meaningful variable names in you calculations (you would have to use indexed vector name) you could do it (a bit awkward) as shown here:

Werner_E_0-1718712616178.png

Additional benefit of this approach is that neither the function definition nor the function call take up much horizontal space and don't spill over the right page margin 😉

 

 

Yes, few moments ago I wanted to post also me this, but I was busy in meanwhile.
@DJNewman another bug was found in PRIME 10...

Cornel_0-1718713254461.png

 

Cornel_1-1718713267539.png

DJNewman
17-Peridot
(To:Cornel)

I agree that it's weird, especially because I can replicate that Prime 9 accepts many more arguments than Prime 10 does, but I disagree that it's a bug, given that this is documented in Help:

https://support.ptc.com/help/mathcad/r10.0/en/index.html#page/PTC_Mathcad_Help/about_built-in_functions.html#

 

"All PTC Mathcad functions, built-in or user-defined, are limited to accepting a maximum of 16 arguments."

 

(I guess you could say Help is wrong in that it seems to be 18 arguments and not 16, but I won't press the issue.)

 

The same quote is on the same page in Prime 9's Help:

https://support.ptc.com/help/mathcad/r9.0/en/index.html#page/PTC_Mathcad_Help/about_built-in_functions.html#


Edit: You have a few courses of action...
1. You can email feedback to the Mathcad Documentation team and say they should repeat the argument limitation number (and maybe use the correct number) on the page about defining user-defined functions by clicking the envelope in the corner

2. You can submit a Mathcad Idea asking the development team to increase the number of arguments for user-defined functions; though you'll have to give some kind of use case justification for why you need so many

I manage the Creo and PTC Mathcad YouTube channels for PTC, as well as all PTC Mathcad marketing in general.

For me its weird that such limitation exist! And even if this limitation had existed should be better at much higher number level of arguments.


@DJNewman wrote:

... but I disagree that it's a bug, given that this is documented in Help:

https://support.ptc.com/help/mathcad/r10.0/en/index.html#page/PTC_Mathcad_Help/about_built-in_functions.html#

 


Well spotted, that hidden info! Thanks for pointing out..

So its not a  bug, but its sure not a feature, either.

 

While I would consider the use case for a function with that many arguments quite limited and as there sure are workarounds like splitting the calculation in more functions (if possible) or the already mentioned use of vectors as arguments, I still consider the limitation to 16 or 18 arguments to be a rather stupid limit. I wasn't aware that Prime introduced that limit here.
And yes, there is quite some room for documentation improvement!

 

Nonetheless I would call it a bug that Prime happily accepts the definition of functions containing more arguments..

An error with a clear error message should be thrown right when the function is defined - an error, not a warning, because at least in P10 a function defined that way can't be used in any way later.

LucMeekes
23-Emerald III
(To:DJNewman)

That same quote is in Prime's Help since after version 2 (Can't find it in Prime2's help; it's there in 3.1), but:

LucMeekes_1-1718746341003.png

I guess the development team found a bug (the limitation in the help is not adhered to by the software) and tried to correct it in Prime 10.

This has all the look and feel of PTC sofware.

 

Success!
Luc

Hello @TNO-HTH

 

It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,

Vivek N.
Community Moderation Team.

LucMeekes
23-Emerald III
(To:vnamboodheri)

I guess the problem of the OP is not solved. It could be solved if:

PTC corrects the documentation to become in line with the implementation, and I strongly recommend an error message on the function definition, where the number of arguments is above the limit.

Better still would be to remove the limitation from the implementation ( keep it as it was before Prime 10) and from the documentation.

 

Success!

Luc

Top Tags