As400Program.ParmToObject Method
Estimated reading time: 4 minutes
Definition
Namespace: ASNA.DataGate.Client
Assembly: ASNA.QSys.DataGate.Client.dll
Converts the specified parameter to an object of the specified type.
Overloads
| Signature | Description |
|---|---|
| ParmToObject(object ParmToObject(ProgParm parameter, Type returnType, int element)) | Converts the specified parameter to an object of the specified type. |
| ParmToObject(object ParmToObject(ProgParm Parameter, Type ReturnType)) | Converts the specified parameter to an object of the specified type. |
| ParmToObject(object ParmToObject(Type returnType, string parameterName, Int32[] elementIndices)) | Converts the specified parameter to an object of the specified type. |
| ParmToObject(object ParmToObject(Type ReturnType, string ParameterName)) | Converts the specified parameter to an object of the specified type. |
object ParmToObject(ProgParm parameter, Type returnType, int element)
Converts the specified parameter to an object of the specified type.
Remarks
This method converts the specified parameter to an object of the specified type in the ASNA DataGate client. It checks if the provided parameter is null or has no metadata, and if so, throws an exception. It also checks if the parameter is structured, and if so, throws an exception. It then creates a new SubParmName with the specified element index and calls the ToObject method of the parameter with the SubParmName.
object ParmToObject(ProgParm parameter, Type returnType, int element)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| ProgParm | parameter | The parameter to convert. |
| Type | returnType | The type to convert the parameter to. |
| Int32 | element | The index of the element to convert, if the parameter is an array. |
Returns
| Type | Description |
|---|---|
| Object | An object of the specified type, representing the specified parameter. |
object ParmToObject(ProgParm Parameter, Type ReturnType)
Converts the specified parameter to an object of the specified type.
Remarks
This method converts the specified parameter to an object of the specified type in the ASNA DataGate client. It checks if the provided parameter is null or has no metadata, and if so, throws an exception. It also checks if the parameter is structured, and if so, throws an exception. It then creates a new SubParmName with the specified element index and calls the ToObject method of the parameter with the SubParmName.
object ParmToObject(ProgParm Parameter, Type ReturnType)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| ProgParm | Parameter | The parameter to convert. |
| Type | ReturnType | The type to convert the parameter to. |
Returns
| Type | Description |
|---|---|
| Object | An object of the specified type, representing the specified parameter. |
object ParmToObject(Type returnType, string parameterName, Int32[] elementIndices)
Converts the specified parameter to an object of the specified type.
Remarks
This method converts the specified parameter to an object of the specified type in the ASNA DataGate client. It checks if the provided parameter name is null, and if so, throws an ArgumentNullException. It then creates a new SubParmName with the specified parameter name and element indices, and gets the parameter with the name from the SubParmName. If no such parameter exists, it throws an ArgumentException. It then calls the ToObject method of the parameter with the SubParmName and the type.
object ParmToObject(Type returnType, string parameterName, Int32[] elementIndices)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| Type | returnType | The type to convert the parameter to. |
| String | parameterName | The name of the parameter to convert. |
| Int32[] | elementIndices | The indices of the elements to convert, if the parameter is an array. |
Returns
| Type | Description |
|---|---|
| Object | An object of the specified type, representing the specified parameter. |
object ParmToObject(Type ReturnType, string ParameterName)
Converts the specified parameter to an object of the specified type.
Remarks
This method converts the specified parameter to an object of the specified type in the ASNA DataGate client. It calls the ParmToObject method with the type, parameter name, and an empty array of element indices.
object ParmToObject(Type ReturnType, string ParameterName)
Parameters
| Type | Parameter name | Description |
|---|---|---|
| Type | ReturnType | The type to convert the parameter to. |
| String | ParameterName | The name of the parameter to convert. |
Returns
| Type | Description |
|---|---|
| Object | An object of the specified type, representing the specified parameter. |