Initializing help system before first use

newref

Purpose
Increase the reference count of a referenced object.
Synopsis
void *newref(XPRMcontext ctx,int type, void *ref);
Arguments
ctx 
Mosel's execution context
type 
Type or structure of the object
ref 
Reference of the object or NULL
Return value
The reference to an object ( i.e. the third argument or a new instance) or NULL in case of error.
Further information
1. If a native function needs to use the reference to an object after its termination, it must tell the system that the corresponding object must be preserved even if it is no longer used in the model: this is the role of this function. When the reference becomes useless for the native code, it must be released by a call to delref. The parameter type can be XPRM_TYP_MPVAR, XPRM_TYP_LINCTR, XPRM_STR_ARR, XPRM_STR_LIST, XPRM_STR_SET, XPRM_STR_PROC or the type code of an external type.
2. If the third argument is NULL, this function returns the reference to a newly created object. However this function cannot be used to create a constant reference, use newcsr for this purpose.
Related topics

© 2001-2025 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.