xojo-option-parser icon indicating copy to clipboard operation
xojo-option-parser copied to clipboard

Add default values for given options

Open jcowgar opened this issue 10 years ago • 1 comments

You can currently specify the default option when you access it:

Dim name As String = options.StringValue("name", "World")

But if you access it multiple times, you have to specify the default value multiple times. The idea here is to specify it at the time the option is created:

Dim o As New Option("n", "name", "Name of person to say hello to")
o.DefaultValue = "World"

.. later ..

Print "Hello, " + options.StringValue("name")

jcowgar avatar Jul 01 '14 18:07 jcowgar