of_addtohistory


pfcutil.pbl   >   pfc_n_cst_sqlspy   >   of_addtohistory   

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

Name Datatype
No Data

Name Datatype
ldm_current datetime
li_null integer
ll_rc long
ls_newentry string
ls_spacing string

protected function integer of_addtohistory (string as_heading, string as_syntax);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_AddToHistory
//
//	Access:  		protected
//
//	Arguments:
//	as_heading		The header information to be added.
//	as_syntax		The detail information to be added.
//
//	Returns:  		integer
//						1 if it succeeds.
//						-1 if an error occurs.
//						If any argument's value is NULL, function returns NULL.
//
//	Description:  	Add a history entry into the RichTextControl.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_newentry
string	ls_spacing
long		ll_rc
datetime ldm_current

//Check parameters
If IsNull(as_heading) or IsNull(as_syntax) Then
	integer li_null
	SetNull (li_null)
	Return li_null
End If

//Add a datetime stamp to the heading
ldm_current = DateTime( Today(), Now())
as_heading = as_heading + '    TimeStamp: ' + string(ldm_current,'dd/mm/yy hh:mm:ss:ff')

//Make the heading a comment
as_heading = '/*** ' + as_heading + ' ***/'

//Determine the needed spacing 
If Len(is_history) > 0 Then
	ls_spacing = '~r~n~r~n'
End If

//Determine what information was passed to function
//  Header and Detail, Header only, or Detail only
If Len(as_heading) > 0 and Len(as_syntax) > 0 Then
	ls_newentry =	ls_spacing + as_heading + '~r~n' + as_syntax
ElseIf Len(as_heading) > 0 Then
	ls_newentry =	ls_spacing + as_heading 
Else
	ls_newentry =	ls_spacing + as_syntax
End If

//Update the history string
is_history = is_history + ls_newentry

//Depending on operating system - prevent the history string from
//getting too long
is_history = of_PreventHistoryOverflow (is_history, ls_newentry)

//If available, Notify visual to update the current history.
If IsValid(iw_sqlspy) Then
	ll_rc = iw_sqlspy.of_UpdateHistory()
End If 

//If available, update the log file
of_AddToLogfile(ls_newentry)

Return 1

end function

     
Name Owner
pfc_n_cst_sqlspy.of_sqlsyntax pfc_n_cst_sqlspy

     
Name Owner
systemfunctions.datetime systemfunctions
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.now systemfunctions
systemfunctions.setnull systemfunctions
systemfunctions.string systemfunctions
systemfunctions.today systemfunctions
pfc_w_sqlspy.of_updatehistory pfc_w_sqlspy
pfc_n_cst_sqlspy.of_addtologfile pfc_n_cst_sqlspy
pfc_n_cst_sqlspy.of_preventhistoryoverflow pfc_n_cst_sqlspy

     
Full name
No Data

     
Name Scope
No Data