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 GetNumParameterCount

Syntax
Object.GetNumParameterCount(ParamName As String) As Long
Parameters
ParamName
The name of a NUMERIC parameter.
Description
Returns the number of values contained by the parameter named ParamName.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NOT_DEFINED

Method GetStrParameterCount

This method retrieves the number of items of string, Boolean, and choice list types. For the string lists, the returned value is the number of elements. For the Boolean lists, the returned value is the number of elements set to true. For the choice lists, the returned value is 1.

Syntax
Object.GetStrParameterCount(ParamName As String)_ As Long
Parameters
ParamName
The name of a STRING parameter.
Description
Returns the number of values contained by the parameter named ParamName.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NOT_DEFINED

Method GetNumParameter

Syntax
Object.GetNumParameter(ParamName As String,_ idx As Long) As Double
Parameters
ParamName
The name of a NUMERIC parameter.
idx
The index of the parameter value.
Remarks
idx counter goes from 0 to NumOfInst -1.
Description
Returns the NUMERIC value contained at the index idx of the parameter named ParamName.
Error codes

S_OK
TMWSERVICE_E_PARAMETER_NOT_DEFINED
TMWSERVICE_E_PARAMETER_BAD_INDEX

Method GetStrParameter

This method retrieves the values of string, Boolean, and choice list types. For the string lists, the returned values are the element value. For the Boolean lists, the returned values are the values of the elements set to true. For the choice lists, the returned value is the selected value.

Syntax
Object.GetStrParameter(ParamName As String, idx As Long) As String
Parameters
ParamName
The name of a STRING parameter.
idx
The index of the parameter value.
Description
Returns the STRING value contained at the index idx of the parameter named ParamName.
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 16. Basic Object Method parameter examples
Visual Basic example:

Dim numVal As Double
Dim strVal As String
Dim paramCount As Long

paramCount = Svc.GetNumParameterCount("NumParam")
For i = 0 To paramCount - 1
numVal = Svc.GetNumParameter("NumParam", i))
Next

paramCount = Svc.GetStrParameterCount("StrParam")
For i = 0 To paramCount - 1
strVal = Svc.GetStrParameter("StrParam", i))
Next

JavaScript example:

var numVal;
var strVal;
var paramCount;

paramCount = Svc.GetNumParameterCount("NumParam");
for(i = 0; i < paramCount; i++) {
numVal = Svc.GetNumParameter("NumParam", i);
}

paramCount = Svc.GetStrParameterCount("StrParam");
for(i = 0; i < paramCount; i++) {
strVal = Svc.GetStrParameter("StrParam", i);
}


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