PDA

View Full Version : Passing parameters


yellowFattyBean
02-10-2011, 01: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.

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

goleafsgo
02-15-2011, 02: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-15-2011, 02: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.