Initializing help system before first use

XPRBgetbyname

XPRBgetbyname


Purpose
Retrieve an object by its name.
Synopsis
void *XPRBgetbyname(XPRBprob prob, const char *name, int type);
Arguments
prob 
Reference to a problem.
name 
The name of the object.
type 
The type of the object sought. This is one of:
XPRB_VAR 
a BCL variable;
XPRB_ARR 
a BCL array of variables;
XPRB_CTR 
a BCL constraint;
XPRB_SOS 
a BCL SOS;
XPRB_IDX 
a BCL index set.
Return value
Reference to a BCL object of the indicated type if function executed successfully, NULL if object not found or in case of an error.
Example
This example finds the variable with the name abc3.
XPRBprob prob;
XPRBvar x1;
 ...
x1 = XPRBgetbyname(prob, "abc3", XPRB_VAR);
Further information
The function returns the reference to an object of the indicated type or NULL. The same name may be used for objects of different types within one problem definition. This function can only be used if the names dictionary is enabled (functions XPRBsetdictionarysize).
Related topics