Computed default value

  • Antonio Piccolboni

    I am specifying an option with a ValArg. The value is optional but in case  it is not specified, no constant value is an appropriate default. The default is a value computed from all the inputs and depending on other arguments, so it becomes available only later on. Therefore I need to detect wether the default has been used or there was actually an argument specified on the command line. There is no specific value I can use as undefined, even if I guess I could use MINDOUBLE and the chance that one in going to specify it on the command line are quite slim -- but this is a horrible hack, not a solution. Any hint? Thanks,


    • Mike Smoot

      Mike Smoot - 2004-07-14

      Just use the isSet() method.  It will only return true if the arg has been set on the command line and is smart enough to accomodate the XOR handling, if you're using that.

      Let me know if this doesn't behave as you expect.



Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks