SLPgetindex


Purpose
Obtain the index of an SLP item from its name
Synopsis
function SLPgetindex(Name:string, Type:integer) : integer
Arguments
Name 
The name of the item whose index is to be found
Type 
The type of item required. The following are pre-defined:
1
Row names
2
Column names
xslp_internalfuncnames
Internal (pre-defined) function names (case sensitive)
xslp_internalfuncnamesnocase
Internal (pre-defined) function names (not case sensitive)
xslp_userfuncnames
User function names (case sensitive)
xslp_userfuncnamesnocase
User function names (not case sensitive)
xslp_xvnames
XV names
There are other types, but they are not usually required for Mosel
Return value
The index of the item requested.
Except for row and column names, a value of zero means that the item was not found.
For row and column names, a negative value means that the item was not found.
Example
The following code fragment gets the index of the user function MoselArea. The first form is case-sensitive, and will find the name exactly as given; the second form is not case-sensitive, and will find the first name regardless of the case of the individual letters. The final call finds the name of the internal (pre-defined) function sin
FuncNum := SLPgetindex("MoselArea",xslp_userfuncnames)
FuncNum := SLPgetindex("MOSELarea",xslp_userfuncnamesnocase)
FuncNum := SLPgetindex("SIN",xslp_internalfuncnamesnocase)
Further information
Use SLPgetindex to obtain the index of a user function which is used in more than one SLPcalluserfunc statement, because using the index is more efficient than using the name when it is required more than once.
Related topics
SLPgetname


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.