of_createlogtext


pfcapsrv.pbl   >   pfc_n_cst_error   >   of_createlogtext   

Full name pfc_n_cst_error.of_createlogtext
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_createlogtext(ref string)

Name Datatype
No Data

Name Datatype
ls_date string
NEWLINE string
TAB string

protected function integer of_createlogtext (ref string as_text);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_CreateLogText
//
//	Access:  		protected
//
//	Arguments: 
//	as_text	The Log Text string (by reference).
//
//	Returns:  		integer
//	1 if it succeeds
//	-1 if it fails.
//
//	Description:	
//	This function is used to create the text that is used	to peform the log process.
//
//	Note:	
//	To create other than the standard text override this function on an descendant.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
// 5.0.02 Add newline character after each error.
// 6.0	Enhanced to have multiple message styles.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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	string NEWLINE = '~r~n'
constant string TAB	= '~t'
string ls_date

If IsNull(inv_errorpass) Or Not IsValid(inv_errorpass) Then
	Return -1
End If

// Make sure there are no Null values.
If Not IsNull(inv_errorpass.idt_date) Then ls_date = String(inv_errorpass.idt_date)
If IsNull(inv_errorpass.is_title) Then inv_errorpass.is_title = ''
If IsNull(inv_errorpass.is_text) Then inv_errorpass.is_text = ''
If IsNull(inv_errorpass.is_user) Then inv_errorpass.is_user = ''
If IsNull(inv_errorpass.is_usertext) Then inv_errorpass.is_usertext = ''

//-- The default text depending on the style. --
CHOOSE CASE ii_logfilestyle
	CASE TAB_DELIMITED
		as_text=	"DateTime: "+ ls_date + TAB + &
					"Title: "+ inv_errorpass.is_title + TAB + &
					"Message: "+ inv_errorpass.is_text + TAB + &
					"User: "+ inv_errorpass.is_user + TAB + &
					"Comments: "+ inv_errorpass.is_usertext
	
	CASE NEWLINE_DELIMITED
		as_text=	"DateTime: "+ ls_date + NEWLINE + &
					"Title:    "+ inv_errorpass.is_title + NEWLINE + &
					"Message:  "+ inv_errorpass.is_text + NEWLINE + &
					"User:     "+ inv_errorpass.is_user + NEWLINE + &
					"Comments: "+ inv_errorpass.is_usertext + NEWLINE	
					
	CASE ELSE
		Return -1
END CHOOSE

// Add newline character after each error.
as_text += NEWLINE 

Return 1
end function

     
Name Owner
pfc_n_cst_error.of_processlog pfc_n_cst_error

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.string systemfunctions

     
Full name
No Data

     
Name Scope
No Data