|
of_setsort
|
|
Full name
|
pfc_n_cst_dwsrv_sort.of_setsort
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_setsort(string)
|
Name
|
Datatype
|
li_rc
|
integer
|
lnv_return
|
n_cst_returnattrib
|
lnv_sortattrib
|
n_cst_sortattrib
|
public function integer of_setsort (string as_format);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_SetSort
//
// Access: Public
//
// Arguments:
// as_format: A string whose value is valid sort criteria for the DataWindow.
// The expression includes column names or numbers. A column number
// must be preceded by a pound sign (#). If format is NULL,
// function prompts you to enter the sort criteria.
//
// Returns: Integer
// 1 if it succeeds.
// 0 User Cancelled out of a dialog window.
// -1 if an error occurs.
//
// Description: Set the sort.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 6.0 Use of constants within services.
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
integer li_rc
n_cst_sortattrib lnv_sortattrib
n_cst_returnattrib lnv_return
// Check the datawindow reference.
If IsNull(idw_Requestor) Or Not IsValid(idw_Requestor) Then Return -1
// If the parameter is not null, then peform a regular SetSort operation.
IF Not IsNull (as_format) THEN
Return idw_Requestor.SetSort (as_format)
END IF
// Passed argument was Null (as_format is null),
// call the appropriate SetSort Dialog.
CHOOSE CASE ii_style
CASE DEFAULT
// 0 = Powerscript default sort style dialog.
li_rc = idw_Requestor.SetSort (as_format)
// Check if the dialog was close via the Cancel button.
If li_rc = -1 Then li_rc = 0
Return li_rc
CASE DRAGDROP, SIMPLE, DROPDOWNLISTBOX
// Call one of the PFC sort dialog windows.
IF of_BuildSortAttrib(lnv_sortattrib) <> 1 THEN Return -1
IF ii_style = 1 THEN
// 1 = Drag and Drop style dialog.
OpenWithParm (w_sortdragdrop, lnv_sortattrib)
ELSEIF ii_style = 2 THEN
// 2 = Simple (single column) style dialog.
OpenWithParm (w_sortsingle, lnv_sortattrib)
ELSE
// 3 = DDLB style dialog.
OpenWithParm (w_sortmulti, lnv_sortattrib)
END IF
// Get the return PowerObject.
lnv_return = Message.PowerObjectParm
// Check if the dialog was close via the Cancel button.
IF lnv_return.ii_rc <> 1 Then Return lnv_return.ii_rc
Return idw_Requestor.SetSort (lnv_return.is_rs)
END CHOOSE
// Invalid option.
Return -1
end function
Name
|
Owner
|
datawindow.setsort |
datawindow
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.isvalid |
systemfunctions
|
systemfunctions.openwithparm |
systemfunctions
|
pfc_n_cst_dwsrv_sort.of_buildsortattrib |
pfc_n_cst_dwsrv_sort
|