# IBM Visualization Data Explorer Programmer's Reference

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

### DXQueryParameter

Function

Determines whether an Object can be converted to a specified value type.

Syntax
`
#include <dx/dx.h>
`

Object DXQueryParameter(Object o, Type t, int dim, int *count)

Functional Details

If the conversion can be performed, the number of resulting elements is returned in `*count` if it is not `NULL`.

For successful conversion, Object `o` must be an Array or a String. If `o` is an Array, then its Category must be `CATEGORY_REAL`, its rank must be either 0 or 1, and it must have at least 1 item contained within.

If `dim` is greater than 1, then `o`'s rank must be 1 and its shape must match `dim` in order for this conversion to be successful. If `dim` is either 0 or 1, then both rank 0 and rank 1 shape 1 Arrays will match in size.

Once it is known that the sizes match, the Array's Type is examined to determine whether it can be converted to the Type specified by `t`. In general, smaller types can be converted to larger types in the following hierarchies: `TYPE_BYTE, TYPE_SHORT, TYPE_INT, TYPE_FLOAT, TYPE_DOUBLE, TYPE_UBYTE, TYPE_USHORT, TYPE_UINT`.

Signed and unsigned types of the same size (e.g., `TYPE_BYTE` and `TYPE_UBYTE`) cannot be converted, nor can a signed type ever be converted to an unsigned type. Unsigned types, however, can be converted to larger signed types (e.g., `TYPE_UBYTE` to `TYPE_SHORT`).

If `o` is a String, `t` must be `TYPE_STRING` and `dim` must be either 0 or 1. If `dim` is 0, the String contained in `o` must contain only a single character.

Return Value

Returns `o` if the conversion can be made or returns `NULL` without setting an error code.

See Also

`DXExtractFloat, DXExtractInteger, DXExtractNthString, DXExtractParameter, DXExtractString, DXQueryArrayConvert, DXQueryArrayConvertV`

12.8 , "Extracting Module Parameters".

[ Top of Page | Previous Page | Next Page | Table of Contents | Partial Table of Contents | Index ]
[Data Explorer Documentation | QuickStart Guide | User's Guide | User's Reference | Programmer's Reference | Installation and Configuration Guide ]

[Data Explorer Home Page]

[IBM Home Page | Order | Search | Contact IBM | Legal ]