of_BuildSortString


pfcdwsrv.pbl   >   pfc_w_sortdragdrop   >   of_BuildSortString   

Full name pfc_w_sortdragdrop.of_BuildSortString
Access protected
Override of string
Return value string
Prototype protected function string of_BuildSortString()

Name Datatype
No Data

Name Datatype
li_i integer
li_max integer
ls_colname string
ls_sortitem string
ls_sortstring string

protected function string of_BuildSortString ();//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_BuildSortString
//
//	Access:    		Protected
//
//	Arguments: 		None
//	
//	Returns:   		String
//   					The new sort string
//
//	Description:  	This function will construct the new sort string
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////

string	ls_colname
string	ls_sortitem
string 	ls_sortstring=''
integer	li_i
integer	li_max

// Loop around all rows.
li_max = dw_sorted.RowCount ( ) 
FOR li_i = 1 to li_max 
	
	// Get the column name.
	ls_colname = dw_sorted.GetItemString (li_i, "columnname")
	IF IsNull(ls_colname) or Len(Trim(ls_colname))=0 Then Continue
	
	// Determine if LookUpDisplay should be used.
	IF dw_sorted.GetItemString (li_i, "use_display" ) = "1" THEN 
		// Use LookUpDisplay.
		ls_sortitem = "LookUpDisplay(" + ls_colname + ") "
	ELSE
		// Do NOT use LookUpDisplay.
		ls_sortitem = ls_colname + " "
	END IF 

	// Append the sort order.
	ls_sortitem = ls_sortitem + dw_sorted.GetItemString (li_i, "sort_order" ) + " "

	// Create the sort criteria.
	ls_sortstring = ls_sortstring + ls_sortitem
NEXT

// Return the new sort string.
Return ls_sortstring
end function

     
Name Owner
pfc_w_sortdragdrop.pfc_default pfc_w_sortdragdrop

     
Name Owner
datawindow.getitemstring datawindow
datawindow.rowcount datawindow
systemfunctions.isnull systemfunctions
systemfunctions.len systemfunctions
systemfunctions.trim systemfunctions

     
Full name
pfc_w_sortdragdrop

     
Name Scope
No Data