Data Model > Extending the UNICOM Intelligence Data Model > Adding function libraries > Functions with hidden parameters
 
Functions with hidden parameters
While some functions are written using the standard interface, most functions require one or more arguments for hidden parameters. In particular, most functions are given at least the locale IDs as hidden arguments to use when formatting error messages.
For example, the IDL definition of the .DefinedCategories function is:
[id(7), helpstring("method DefinedCategories")] HRESULT MR_LCIDMDMID_DefinedCategories(
[in] long lInputLCID,
[in] long lOutputLCID,
[in] IUnknown *pLevel,
[in] BSTR sId,
[in, defaultvalue("..")] VARIANT Answers,
[out, retval] SAFEARRAY(VARIANT) *paResult);
To define functions that require arguments for hidden parameters, the name is prefixed with the function type. For example, if you look at the IDL definition for the DefinedCategories function shown above, you can see that it has an MR_LCIDMDMID_ prefix. This prefix is made up of a number of subprefixes.
The subprefixes that can be used are shown in the following table. When more than one subprefix is used, the subprefixes must be used in the order shown in the table and must be followed by an underscore character (_).
Function type
Subprefix
Description
Standard
None
All functions that do not contain hidden parameters.
Generic
MR_
Generic prefix that must always precede any of the other prefixes.
Runtime
RT
Functions that require the scripting runtime. This can be either the script engine (IScriptEngine) and a script program (IScriptProgram) or the evaluate engine (IEvaluate) and an expression program (IExpressionProgram). The first hidden argument is the scripting engine and the second is the script program.
Value Interface
IVAL
Functions that require direct access to the IValue interface associated with a value. The first hidden argument for this prefix is the value interface and the second is the identifier name.
Locale
LCID
Functions that require the input and output locale IDs to be passed as hidden arguments. The first hidden argument for this prefix is the input locale ID and the second is the output locale ID.
MDM 
MDM
Functions that require an instantiated level object pointer of type IUnknown as a hidden argument, so that the IArray interface can be used to access the level object's Fields or Types collections. The level object can be a MDM Document, an Array or a Grid.
Identifier
ID
Functions that require the identifier name as a hidden argument. The value passed is the RelativeName of the object containing elements, in the level object's Fields or Types collections.
For example, in Visual C++, you would need to define hidden parameters to functions with the various subprefixes as follows:
RT [in] IDispatch* pEngine, [in] IDispatch* pProgram
IVAL [in] IUnknown* pValue, [in] BSTR sId
LCID [in] long lInputLCID, [in] long lOutputLCID
MDM [in] IUnknown* pLevel
ID [in] BSTR sId
See also
Function library registration
Functions with optional or variable parameters
Name resolution and function precedence
Custom function example
Adding function libraries