of_preventhistoryoverflow


pfcutil.pbl   >   pfc_n_cst_sqlspy   >   of_preventhistoryoverflow   

Full name pfc_n_cst_sqlspy.of_preventhistoryoverflow
Access protected
Extend of string
Return value string
Prototype protected function string of_preventhistoryoverflow(string,string)

Name Datatype
No Data

Name Datatype
ll_historylength long
ll_pos long
ll_startposition long
ls_null string
TEST_LENGTH long

protected function string of_preventhistoryoverflow (string as_history, string al_newentry);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_PreventHistoryOverflow
//
//	Access:  		protected
//
//	Arguments:
//	as_history		The history string.
//	al_newentry 	The latest new entry to be added to the history string.
//
//	Returns:  		string
//						The manipulated string.
//						If any argument's value is NULL, function returns NULL.
//
//	Description:  	Prevent the history string from growing past the maximum
//						supported by the Operating Environment.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////

constant long TEST_LENGTH = 32700

long	ll_pos
long	ll_startposition
long	ll_historylength

//Check parameters
If IsNull(as_history) or IsNull(al_newentry) Then
	string ls_null
	SetNull (ls_null)
	Return ls_null
End If

//Get the position on which to start searching in order for 
//the new string not be any longer than the original string
//prior to the newentry
ll_startposition = Len(al_newentry)

//Get the current length of the history string
ll_historylength = Len(as_history)

If ll_historylength > TEST_LENGTH Then
	ll_pos = Pos(as_history, '/***', ll_startposition)
	If ll_pos > 0 Then
		as_history = Mid(as_history, ll_pos, ll_historylength)
	End If
End If

Return as_history

end function

     
Name Owner
pfc_n_cst_sqlspy.of_addtohistory pfc_n_cst_sqlspy

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.len systemfunctions
systemfunctions.mid systemfunctions
systemfunctions.pos systemfunctions
systemfunctions.setnull systemfunctions

     
Full name
No Data

     
Name Scope
No Data