of_ParseSortAttrib


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_sort   >   of_ParseSortAttrib   

Full name pfc_n_cst_dwsrv_sort.of_ParseSortAttrib
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_ParseSortAttrib(string,ref n_cst_sortattrib)

Name Datatype
No Data

Name Datatype
li_i integer
li_num_cols integer
lnv_string n_cst_string
ls_parse string

protected function integer of_ParseSortAttrib (string as_originalsort, ref n_cst_sortattrib anv_sortattrib);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_ParseSortAttrib
//
//	Access:    		Protected
//
//	Arguments:
//   as_originalsort:	A string containing the original sort statement
//   anv_sortattrib:		A NVO attribute class, passed by reference, that 
//				 				will hold sort information used by the Sort dialogs.
//
//	Returns:   		Integer
//   					1 if it succeeds and -1 if an error occurs.
//
//	Description:  	Parses a sort statement into individual parts.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////

integer			li_num_cols
integer			li_i
string			ls_parse
n_cst_string	lnv_string

// Parse the original sort string into separate elements, 
// in order to display the original sort when the user
// opens a sort dialog.
lnv_string.of_ParseToArray ( as_originalsort, ",", anv_sortattrib.is_origcolumns )

// Loop around all array entries.
li_num_cols = UpperBound ( anv_sortattrib.is_origcolumns ) 
FOR li_i = 1 to li_num_cols
	ls_parse = anv_sortattrib.is_origcolumns[li_i]
	
	// Remove the LookUpDisplay function if it was used in the sort.
	If Pos(Lower(ls_parse), Lower("LookUpDisplay(")) > 0 Then
		ls_parse = lnv_string.of_GlobalReplace ( ls_parse, "LookUpDisplay(", "" ) 
		ls_parse = lnv_string.of_GlobalReplace ( ls_parse, ")", "" ) 
		ls_parse = Trim ( ls_parse ) 
	End If
	
	anv_sortattrib.is_origcolumns[li_i] = lnv_string.of_GetToken (ls_parse, " ") 
	anv_sortattrib.is_origorder[li_i] = ls_parse 
NEXT 

Return 1
end function

     
Name Owner
pfc_n_cst_dwsrv_sort.of_buildsortattrib pfc_n_cst_dwsrv_sort

     
Name Owner
systemfunctions.lower systemfunctions
systemfunctions.pos systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_string.of_parsetoarray pfc_n_cst_string
pfc_n_cst_string.of_gettoken pfc_n_cst_string
pfc_n_cst_string.of_globalreplace pfc_n_cst_string

     
Full name
No Data

     
Name Scope
No Data