Group Abstract Group Abstract

Message Boards Message Boards

1
|
2.9K Views
|
4 Replies
|
6 Total Likes
View groups...
Share
Share this post:

How to check arguments so only 1 argument is accepted with CheckArguments?

POSTED BY: Peter Burbery
4 Replies

I looked at CheckArguments documentation but it was kind of confusing because it used an option, which I don't need.

Many functions have options, most of the time you don't need them and that is why they are optional. Why is that confusing?

Your usage of CheckArguments seems correct, and if it works for you then why not use it? It is certainly more straightforward than the resource function you linked.

POSTED BY: Jason Biggs

I just meant it was extra information. I relent in the criticism.

POSTED BY: Peter Burbery
Posted 2 years ago

Some other ways to do this on MSE.

POSTED BY: Rohit Namjoshi

There's a helpful ResourceFunction for this at https://resources.wolframcloud.com/FunctionRepository/resources/DeclareArgumentCount/. I am considering adding this to a paclet.

POSTED BY: Peter Burbery
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard