IBM Tivoli Software IBM Tivoli Software

[ Bottom of Page | Previous Page | Next Page | Contents | Index ]


Parameters

The following methods help you to express functions for parameters configuration.

Method DefineStrParameter

Syntax
Object.DefineStrParameter(ParamName As String, values As String)
Parameters
ParamName
The name of a new STRING parameter.
values
Comma-separated values of the parameter default values.
Description
Defines a new STRING parameter.
Remarks
This method is called inside the <<PARAMETERS_INFO>>...<<\PARAMETERS_INFO>> tags after you have defined a parameter in the Parameters window.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NAME_NOT_VALID

Method DefineNumParameter

Syntax
Object.DefineNumParameter(ParamName As String, values As String)
Parameters
ParamName
The name of a new NUMERIC parameter
values
Comma-separated values of the parameter default values.
Description
Defines a new NUMERIC parameter.
Remarks
This method is called inside the <<PARAMETERS_INFO>>...<<\PARAMETERS_INFO>> tags after you have defined a parameter in the Parameters window.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NAME_NOT_VALID

Method AddStrParameter

Syntax
Object.AddStrParameter(ParamName As String, Value As String)
Parameters
ParamName
The name of a STRING parameter.
Value
A STRING value.
Description
Adds the given Value at the end of the parameter named ParamName.
Remarks
This method is called after you have defined a new parameter in the Parameters window.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NOT_DEFINED
TMWSERVICE_E_PARAMETER_BAD_INDEX

Method AddNumParameter

Syntax
Object.AddNumParameter(ParamName As String, Value As Double)
Parameters
ParamName
The name of a NUMERIC parameter.
Value
A NUMERIC value.
Description
Adds the given Value at the end of the parameter named ParamName.
Remarks
This method is called after you have defined a new parameter in the Parameters window.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NOT_DEFINED
TMWSERVICE_E_PARAMETER_BAD_INDEX

Method RemoveStrParameter

Syntax
Object.RemoveStrParameter(ParamName As String, idx As Long)
Parameters
ParamName
The name of a STRING parameter.
idx
The index of a parameter value.
Description
Removes the value contained at the given index and shifts down all the values after the removed one.
Remarks
idx counter goes from 0 to NumOfInst -1.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NOT_DEFINED
TMWSERVICE_E_PARAMETER_BAD_INDEX

Method RemoveNumParameter

Syntax
Object.RemoveNumParameter(ParamName As String, idx As Long)
Parameters
ParamName
The name of a NUMERIC parameter.
idx
The index of a parameter value.
Description
Removes the value contained at the given index and shifts down all the values after the removed one.
Remarks
idx counter goes from 0 to NumOfInst -1.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NOT_DEFINED
TMWSERVICE_E_PARAMETER_BAD_INDEX

Method ReplaceStrParameter

Syntax
Object.ReplaceStrParameter(ParamName As String,_ 
idx As Long, Value As String)
Parameters
ParamName
The name of a STRING parameter.
idx
The index of a parameter value.
Value
A STRING value.
Description
Replaces the value contained at the given index with the new value.
Remarks
idx counter goes from 0 to NumOfInst -1.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NOT_DEFINED
TMWSERVICE_E_PARAMETER_BAD_INDEX

Method ReplaceNumParameter

Syntax
Object.ReplaceNumParameter(ParamName As String,_ 
idx As Long, Value As Double)
Parameters
ParamName
The name of a NUMERIC parameter.
idx
The index of a parameter value.
Value
A NUMERIC value.
Description
Replaces the value contained at the given index with the new value.
Remarks
idx counter goes from 0 to NumOfInst -1.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NOT_DEFINED
TMWSERVICE_E_PARAMETER_BAD_INDEX

Example

Table 23. Advanced Object Method parameter examples
Visual Basic example:

Svc.DefineStrParameter("strParam", "item1,item2") 'values are item1 and item2
Svc.AddStrParameter("strParam", "item3") 'values are item1, item2, item3
Svc.ReplaceStrParameter("strParam", 2, "toBeDeleted") 'values are item1,
item2, toBeDeleted
Svc.RemoveStrParameter("strParam", 2) 'values are item1 and item2

Svc.DefineNumParameter("numParam", "1,2") 'values are 1,2
Svc.AddNumParameter("numParam", 3) 'values are now 1,2,3
Svc.ReplaceNumParameter("numParam", 2, 2) 'values are now 1,2,2
Svc.RemoveNumParameter("numParam", 1) 'values are now 1,2

JavaScript example:

Svc.DefineStrParameter("strParam", "item1,item2"); //values are item1 and item2
Svc.AddStrParameter("strParam", "item3"); //values are item1, item2, item3
Svc.ReplaceStrParameter("strParam", 2, "toBeDeleted"); //values are item1,
item2, toBeDeleted
Svc.RemoveStrParameter("strParam", 2); //values are item1 and item2

Svc.DefineNumParameter("numParam", "1,2"); //values are 1,2
Svc.AddNumParameter("numParam", 3); //values are now 1,2,3
Svc.ReplaceNumParameter("numParam", 2, 2); //values are now 1,2,2
Svc.RemoveNumParameter("numParam", 1); //values are now 1,2


[ Top of Page | Previous Page | Next Page | Contents | Index ]