#!F-adobe-helvetica-medium-r-normal--18* #!N #!CNavyBlue #!N #!Rmdeps Extracting Module Parameters #!N #!EC #!N #!N 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 #!F-adobe-times-bold-r-normal--18* NULL #!EF but do not set the error code. Otherwise they return the original Object and fill in the pointer to the item. #!N #!N 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. #!N #!I0 #!N #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Object DXExtractInteger() #!EF #!EF #!I50 #!N Determines whether an Object can be converted to an integer and, if so, extracts it. See #!Lun7,dxall1087 s Note on Use #!EL . See #!Ldxei,dxall1208 h DXExtractInteger #!EL . #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Object DXExtractFloat() #!EF #!EF #!I50 #!N Determines whether an Object can be converted to a floating-point value and, if so, extracts it. See #!Ldxef,dxall1207 h DXExtractFloat #!EL . #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Object DXExtractString() #!EF #!EF #!I50 #!N Determines whether an Object can be converted to a string and, if so, extracts it. See #!Lun7,dxall1087 s Note on Use #!EL . See #!Ldxes,dxall1211 h DXExtractString #!EL . #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Object DXExtractNthString() #!EF #!EF #!I50 #!N Determines whether an Object can be converted to a list of strings and, if so, extracts the #!F-adobe-times-medium-i-normal--18* n #!EF th one from it. See #!Ldxens,dxall1209 h DXExtractNthString #!EL . #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Object DXQueryParameter() #!EF #!EF #!I50 #!N Determines whether an Object can be converted to a specific value type. See #!Ldxqp,dxall1347 h DXQueryParameter #!EL . #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Object DXExtractParameter() #!EF #!EF #!I50 #!N Determines whether an Object can be converted to a specific value type and, if so, returns the value in the user-provided buffer. See #!Ldxep,dxall1210 h DXExtractParameter #!EL . #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Error DXQueryArrayConvert() #!EF #!N Error DXQueryArrayConvertV(); #!EF #!I50 #!N Determine if the given Array can be converted to an Array with the given type, category, rank, and shape. See #!Ldxqacv,dxall1340 h DXQueryArrayConvert, DXQueryArrayConvertV #!EL . #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Error DXQueryArrayCommon() #!EF #!N Error DXQueryArrayCommonV(); #!EF #!I50 #!N Return a type, category, rank, and shape to which all of the arrays can be converted. See #!Ldxqacvm,dxall1339 h DXQueryArrayCommon, DXQueryArrayCommonV #!EL . #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Error DXArrayConvert() #!EF #!N Error DXArrayConvertV(); #!EF #!I50 #!N Create a new Array with a given type, category, rank, and shape from the data in the given Array. See #!Ldxacv,dxall1174 h DXArrayConvert, DXArrayConvertV #!EL . #!N #!I0 #!N #!F-adobe-times-bold-r-normal--18* #!F-adobe-times-bold-r-normal--18* Array DXScalarConvert() #!EF #!EF #!I50 #!N Converts the contents of an Array into scalar floating-point values. See #!Ldxsct,dxall1364 h DXScalarConvert #!EL . #!I0 #!N #!N #!CIndianRed #!N #!N #!N #!F-adobe-times-bold-r-normal--18* id=un7.Note on Use #!Run7 #!N #!N If a routine expects either a character string or an integer, the following code would determine the case and return the value. #!CForestGreen #!N #!N #!F-adobe-courier-bold-r-normal--18* #!N Object o = input_object_to_check; #!N char *cp; #!N int i; #!N #!N if (DXExtractInteger(o, &i)) #!N x = i; #!N else if (DXExtractString(o, &cp)) #!N strcpy(buffer, cp); #!N else #!N DXSetError(...); #!EF #!N #!N #!EC #!N #!N #!EC #!N #!N #!N #!F-adobe-times-medium-i-normal--18* Next Topic #!EF #!N #!N #!Lcrtdxos,dxall1088 h Creating Simple Data Explorer Objects #!EL #!N #!F-adobe-times-medium-i-normal--18* #!N
Generated by dwww version 1.15 on Sat Jun 22 12:47:13 CEST 2024.