# IBM Visualization Data Explorer Programmer's Reference

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

## 12.8 Extracting Module Parameters

This section describes routines that aid in the parsing of parameters to modules. Inputs to modules that are simple items such as integers, floats, and character strings are packaged as Array Objects. The following routines simplify the extraction of such values. If the Object does not match (even if promoted as described in the following material), the routines return `NULL` but do not set the error code. Otherwise they return the original Object and fill in the pointer to the item.

If a float is expected, a byte, short, int, or long can be promoted to float. If an integer is expected, a byte or short can be promoted. If a float vector is expected, a byte, short, or integer vector can be promoted. If a string is expected, either a String Object or an Array of characters is accepted.

`Object DXExtractInteger()` | Determines whether an Object can be converted to an integer and, if so, extracts it. See Note on Use. See DXExtractInteger.
`Object DXExtractFloat()` | Determines whether an Object can be converted to a floating-point value and, if so, extracts it. See DXExtractFloat.
`Object DXExtractString()` | Determines whether an Object can be converted to a string and, if so, extracts it. See Note on Use. See DXExtractString.
`Object DXExtractNthString()` | Determines whether an Object can be converted to a list of strings and, if so, extracts the nth one from it. See DXExtractNthString.
`Object DXQueryParameter()` | Determines whether an Object can be converted to a specific value type. See DXQueryParameter.
`Object DXExtractParameter()` | Determines whether an Object can be converted to a specific value type and, if so, returns the value in the user-provided buffer. See DXExtractParameter.
`Error DXQueryArrayConvert() Error DXQueryArrayConvertV();` | Determine if the given Array can be converted to an Array with the given type, category, rank, and shape. See DXQueryArrayConvert, DXQueryArrayConvertV.
`Error DXQueryArrayCommon() Error DXQueryArrayCommonV();` | Return a type, category, rank, and shape to which all of the arrays can be converted. See DXQueryArrayCommon, DXQueryArrayCommonV.
`Error DXArrayConvert() Error DXArrayConvertV();` | Create a new Array with a given type, category, rank, and shape from the data in the given Array. See DXArrayConvert, DXArrayConvertV.
`Array DXScalarConvert()` | Converts the contents of an Array into scalar floating-point values. See DXScalarConvert.

Note on Use

If a routine expects either a character string or an integer, the following code would determine the case and return the value.

        Object o = input_object_to_check;
        char *cp;
        int i;
        if (DXExtractInteger(o, &i))
            x = i;
        else if (DXExtractString(o, &cp))
            strcpy(buffer, cp);
        else
            DXSetError(...);

[ 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 ]