Initializing help system before first use

gettypeprop

gettypeprop


Purpose
Get a property of a type.
Synopsis
int gettypeprop(XPRMcontext ctx, int type, int prop, XPRMalltypes *value);
Arguments
ctx 
Mosel's execution context
type 
Code of a type
prop 
Property to retrieve. Possible values:
XPRM_TPROP_NAME 
Name of the type
XPRM_TPROP_FEAT 
Encoded features
XPRM_TPROP_EXP 
Expanded type
XPRM_TPROP_PBID 
Problem index ( -1 if the type is not a problem)
value 
Pointer to an area where the type property is returned
Return value
0 if successful, -1 if type is not valid and 1 if prop is not supported.
Further information
1. This function returns a property of an external type (types provided by modules or user defined). For the property XPRM_TPROP_NAME, the type name is returned in value->string, for the 3 other properties, the result is returned in value->integer.
2. The type features are bit encoded as follows:
XPRM_MTP_CREAT 
Creation function available for this type
XPRM_MTP_DELET 
Deletion function available for this type
XPRM_MTP_TOSTR 
Type can be converted to a string
XPRM_MTP_FRSTR 
Type can be initialized from a string
XPRM_MTP_PRTBL 
Type can be converted to a string after execution
XPRM_MTP_RFCNT 
Type implements reference count
XPRM_MTP_COPY 
Type implements copy: it may be used in assignments
XPRM_MTP_APPND 
The copy function of this type supports appending
XPRM_MTP_ORSET 
The copy function of this type can only be used to reset an object
XPRM_MTP_PROB 
Type is a problem

3. The expanded type is available for user defined types only: it corresponds to the actual type (including structure information) associated to a user defined type code. For instance, assuming the type myset is defined as a set of integer, getting the type expansion for the code associated to myset will give XPRM_STR_SET|XPRM_TYP_INT indicating that a reference to an entity of type myset has to be handled with functions for sets.
4. Trying to get the expanded type of a module type or the features of a user defined type is an error: the function returns 1. This can be used to identify module types.
5. A user type which expanded value is XPRM_STR_REC is a record type. The public fields of a record type may be enumerated with getnextfield.
6. A user type which expanded value is XPRM_STR_PROB is a problem type. The components of a problem type may be enumerated with getnextpbcomp. Note that problem types are also implemented as native types. In this case, the flag XPRM_MTP_PROB will be set in the type features.
Related topics

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.