SLPgetindex
PurposeObtain the index of an SLP item from its nameSynopsisfunction 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:There are other types, but they are not usually required for Mosel
- 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
Return valueThe 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.ExampleThe 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 sinFuncNum := SLPgetindex("MoselArea",xslp_userfuncnames) FuncNum := SLPgetindex("MOSELarea",xslp_userfuncnamesnocase) FuncNum := SLPgetindex("SIN",xslp_internalfuncnamesnocase)Further informationUse 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
If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.