View Full Version : Passing parameters

02 February 2011, 02:08 PM
Hello. I written a command in C++ and have a couple of integers which are hard coded. I with to make it so when the command is run, users will have to pass their own parameters.

02 February 2011, 02:52 PM
just add a command flag then? if user supplies it, use that value, otherwise go with some default value.

02 February 2011, 03:32 AM
Are you trying to force a caller to always send the values? If so, then I think you can do that by setting up the command syntax to take a minimum # of arguments. This is a min # of arguments to the *command* and not a flag. I can't remember the API functions to call to do it but you should be able to say that your command takes, for example, a minimum of 2 arguments and you can say that the first two are the values you are interested in.

If you just want them to be able to *optionally* set the values, then you should just add a flag like uiron suggested.

CGTalk Moderation
02 February 2011, 03:32 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.