Skip to main content

Config.GetOption

Tries to get a value from a config.

Syntax​

Config.GetOption *config "key" default_value?

Returns​

unknown value

Arguments​

NameRequiredTypeDescription
configYesa reference to CustomConfig object.
keyYesAny text e.g. "Hello, World!"
default valueNoAny valueThe value to return if the key is not found.

Details​

It's advised that you set the 'default value' argument if you don't want an error to occur if no key is found.

Possible errors​

  • The requested key was not found in the config.

Validated examples using this method​

On a running server​

Use serhelp Config.GetOption to inspect the reference generated by your installed SER version.