Sort data in a given set.


pCDLSort ( out   vlStatus,
           in    vlOperation,
           inout vlNumRecords,
           in    vlTitle,
           in    vlSetName,
           in    vlNumEntSets,
           in    vlFieldName )



The output parameter indicating the success or failure of the program.


This parameter indicates if pCDLFind should enable a sort operation ("SORT") or close the window ("CLOSE") and return to the calling point.


The number of records sorted in the resulting set.


The window caption to use for the sort window.


The name of the set that will be sorted by pCDLSort.  If left blank or set to $Null, the current set is used.


The number of components in the set specification.


The initial field name to be displayed in the field list.


pCDLSort displays a window containing a list of fields in the target set and a list of sort fields (initially empty). The list of fields is taken either from a variable vFieldList or from a set called sFieldList which must be a set defined on Fields. (Both vFieldList and sFieldList are defined in $DeployServices). If vFieldList is neither blank nor $NULL, it is assumed to contain a list of field names, delimited by a semicolon (e.g. "LastName;FirstName;DepartmentNum"). If vFieldList is either blank or $NULL, then sFieldList is used. In all cases, when pCDLSort returns, vFieldList is set to $NULL.

The field names are shown with their owner's name if vlNumEntSets is greater than one. If vlFieldName is specified, it becomes the initial field in the list. Fields can be selected from the field list and appended to the sort field list. The first field added is the primary sort field and so on. For each sort field, sorting can be in ascending or descending order. Sorting is performed on the set named in vlSetName when the Sort button is pressed.

On the first call to pCDLSort, vlOperation should be set to "SORT". If a sort is performed, pCDLSort returns with vlStatus equal to "OK" but the window remains open. Another call to pCDLSortt should be made with vlOperation set to "CLOSE" or "SORT". For "CLOSE", the window is closed and vlStatus is returned as "COMPLETE". For "SORT", the user can decide to perform either another Sort operation or the Sort window can be closed by selecting the Close button. In the latter case, vlStatus is set to "COMPLETE".