GetOptProbInstList function

Syntax

GetOptProbInstList(ProblemType , OutputErrorCode [, Prefix] [, &detailedstatus])

Description

The GetOptProbInstList function gets the list of all analytic instance IDs in an analytic type.

Parameters

Parameter Description

ProblemType

Enter the name of the analytic type that you created in Application Designer.

OutputErrorCode

Future use. Always returns zero.

Prefix

(Optional) Enter a string. If used, this prefix causes the returned list to include only the analytic instance IDs that start with this prefix. If not used, all the analytic instance IDs in the analytic type are returned.

&detailedstatus

(Optional) This status reference parameter returns an integer value giving further information about the evaluation of this function. The value returned is one of the following:

  • %OptEng_Success: The function completed successfully.

  • %OptEng_Fail: The function failed.

  • %OptEng_Invalid_Piid: The analytic type name passed to the function is invalid.

Returns

Returns an array of strings containing the optimization analytic instance list.

Example

The following example shows the usage of GetOptProbInstList to fill the display field on a page:

Global string &probinst;
Local integer &detailedstatus;
Local integer &iloop;
Local array of string &instarray;

QEOPT.OPERATOR = %UserId;

&instarray = GetOptProbInstList(QEOPT.PROBTYPE, &ret, &detailedstatus);

If &ret <> %OptEng_Success Then
   QEOPT_WRK.MESSAGE_TEXT = "Could not get analytic instances 
 for analytic type " | QEOPT.PROBTYPE ;
Else
   For &iloop = 1 To &instarray.Len
      QEOPT_WRK.MESSAGE_TEXT = QEOPT_WRK.MESSAGE_TEXT | &instarray[&iloop] | " ";
   End-For;
End-If;

The following example shows the use of the optional status parameter:

&instarray = GetOptProbInstList(QEOPT.PROBTYPE, &ret, &detailedstatus);
If &ret <> %OptEng_Success and &detailedstatus=%OptEng_Invalid_Piid Then
   QEOPT_WRK.MESSAGE_TEXT = "Could not get analytic instances for analytic type " 
| QEOPT.PROBTYPE | "because bad piid" ;
End-If;