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(any,any)

Name Datatype
No Data

Name Datatype
ls_keytype1 string
ls_keytype2 string

public function integer of_compare (any aa_value1, any aa_value2);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_Compare
//
//	Access:  public
//
//	Arguments : 
//	aa_value1  first value
//	aa_value2  second value
//
//	Returns:  integer
//	0 : EQUAL  -  if aa_value1 = aa_value2
// 1 : LESSTHAN - if aa_value1 < aa_value2
//	2 : GREATERTHAN - if aa_value1 > aa_value2
// -1 : FAILURE (could be datatypes of values do not match, 
//						one of the values is null,
// 					one of the values is not a simple type, ...)
//
//	Description:  
//	Performs a simple comparision of the values.
//
// 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.
//
//////////////////////////////////////////////////////////////////////////////

string ls_keytype1
string ls_keytype2

// Validate the parameters.
If IsNull(aa_value1) Then return FAILURE
If IsNull(aa_value2) Then return FAILURE

// Get the values type.
ls_keytype1 = classname(aa_value1)
ls_keytype2 = classname(aa_value2)

// Comfirm keytypes are comparable.
if ls_keytype1 <> ls_keytype2 then 
	// key class types are different so we cannot perform a compare
	return FAILURE
end if

// Validate keytypes.
if ls_keytype1 = "" or isnull(ls_keytype1) then return FAILURE
if ls_keytype2 = "" or isnull(ls_keytype2) then return FAILURE

// -- Values are comparable.  --
if aa_value1 < aa_value2 then
	return LESSTHAN
elseif aa_value1 = aa_value2 then
	return EQUAL
else
	return GREATERTHAN
end if
end function

     
Name Owner
pfc_n_cst_nodecomparebase.of_compare pfc_n_cst_nodecomparebase

     
Name Owner
systemfunctions.classname systemfunctions
systemfunctions.isnull systemfunctions

     
Full name
No Data

     
Name Scope
No Data