Initializing help system before first use

XSLPgetindex

XSLPgetindex


Purpose
Retrieve the index of an Xpress NonLinear entity with a given name
Synopsis
int XPRS_CC XSLPgetindex(XSLPprob Prob, int Type, char *cName, int *Index);
Arguments
Prob 
The current SLP problem.
Type 
Type of entity. The following are defined:
XSLP_CVNAMES 
(=3) Character variables;
XSLP_USERFUNCNAMES 
(=5) User functions;
XSLP_INTERNALFUNCNAMES 
(=6) Internal functions;
XSLP_USERFUNCNAMESNOCASE 
(=7) User functions, case insensitive;
XSLP_INTERNALFUNCNAMESNOCASE 
(=8) Internal functions, case insensitive;

The constants 1 (for row names) and 2 (for column names) may also be used.

cName 
Character string containing the name, terminated by a null character.
Index 
Integer to receive the index of the item.
Example
The following example retrieves the index of the internal SIN function using both an upper-case and a lower case version of the name.
int UpperIndex, LowerIndex;
XSLPgetindex(Prob, XSLP_INTERNALFUNCNAMESNOCASE,
             "SIN", &UpperIndex);
XSLPgetindex(Prob, XSLP_INTERNALFUNCNAMESNOCASE,
             "sin", &LowerIndex);
UpperIndex and LowerIndex will contain the same value because the search was made using case-insensitive matching.
Further information

All entities count from 1. This includes the use of 1 or 2 (row or column) for Type. A value of zero returned in Index means there is no matching item. The case-insensitive types will find the first match regardless of the case of cName or of the defined function.


Related topics