Main Content

isOption

Class: coder.make.BuildConfiguration
Package: coder.make

Determine if option exists

Syntax

OutputValue = isOption(OptionName)

Description

OutputValue = isOption(OptionName) returns '1' (true) if the specified option exists. Otherwise, it returns '0' (false).

Input Arguments

expand all

BuildConfiguration handle, specified as a coder.make.BuildConfiguration object.

Example: h

Name of option, specified as a character vector. Choose a new option name.

Example: 'faster2'

Data Types: char

Output Arguments

expand all

Option exists, returned as a logical value. If the option exists, the value is '1' (true). Otherwise, the output is '0' (false).

Examples

Using the Option-related methods interactively

tc = coder.make.ToolchainInfo;
cfg = tc.getBuildConfiguration('Faster Builds');
cfg.isOption('X Compiler')
ans  = 

     0
bi = coder.make.BuildItem('WV','wrongvalue')
bi = 

	Macro  : WV
	Value : wrongvalue
cfg.addOption('X Compiler',bi);
value = cfg.getOption('X Compiler')
value = 

	Macro  : WV
	Value : wrongvalue
cfg.setOption('X Compiler','rightvalue');
value = cfg.getOption('X Compiler')
value = 

	Macro  : WV
	Value : rightvalue