of_compare


pfcapsrv.pbl   >   pfc_n_cst_nodecomparebase   >   of_compare   

Full name pfc_n_cst_nodecomparebase.of_compare
Access public
Extend of integer
Return value integer
Prototype public function integer of_compare(n_cst_nodebase,n_cst_nodebase)

Name Datatype
No Data

Name Datatype
la_key1 any
la_key2 any
li_rc integer

public function integer of_compare (n_cst_nodebase anv_node1, n_cst_nodebase anv_node2);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_Compare
//
//	Access:  public
//
//	Arguments : 
//	anv_node1  first node
//	anv_node2  second node
//
//	Returns:  integer
//	0 : EQUAL  -  if anv_node1 = anv_node2
// 1 : LESSTHAN - if av_node1 < anv_node2
//	2 : GREATERTHAN - if anv_node1 > anv_node2
// -1 : FAILURE (could be datatypes of keys do not match, 
//						one of the nodes is invalid, one of the keys is null,
// 					one of the keys is not a simple type, ...)
//
//	Description:  
//	Performs a simple comparision of the keys from each of the passed 
//	nodes. 
//
// Note:
//	If a more complicated comparision is needed, 
//	recommend that the developer inherit and override this function and 
//	perform the test there. If you do override, MAKE SURE that you 
//	continue to provide the same return codes as this function does
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	6.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.
//
//////////////////////////////////////////////////////////////////////////////

any	 	la_key1
any	 	la_key2
integer	li_rc

// Validate the parameters.
if Isnull(anv_node1) or Not IsValid(anv_node1) then return FAILURE
if Isnull(anv_node2) or Not IsValid(anv_node2) then return FAILURE

// Get the keys.
anv_node1.of_getkey(la_key1)
anv_node2.of_getkey(la_key2)

// Compare the values.
li_rc = of_Compare(la_key1, la_key2)

Return li_rc
end function

     
Name Owner
pfc_n_cst_tree.of_search pfc_n_cst_tree
pfc_n_cst_tree.of_addnode pfc_n_cst_tree
pfc_n_cst_tree.of_delnode pfc_n_cst_tree
pfc_n_cst_list.of_find pfc_n_cst_list
pfc_n_cst_list.of_add pfc_n_cst_list

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
pfc_n_cst_nodecomparebase.of_compare pfc_n_cst_nodecomparebase
pfc_n_cst_nodebase.of_getkey pfc_n_cst_nodebase

     
Full name
No Data

     
Name Scope
No Data