of_SetTrace


pfcmain.pbl   >   pfc_n_tr   >   of_SetTrace   

Full name pfc_n_tr.of_SetTrace
Access public
Extend of integer
Return value integer
Prototype public function integer of_SetTrace(boolean)

Name Datatype
No Data

Name Datatype
KEYWORD string
li_keywordpos integer
ls_dbms string

public function integer of_SetTrace (boolean ab_trace);//////////////////////////////////////////////////////////////////////////////
//	Public Function:  of_SetTrace
//	Arguments:		ab_trace   the desired trace property value.
//	Returns:			integer
//	 					1 = success
//	 					0 = trace property was already the desired value
//						-1 = error
//	Description:	Sets the trace property
//////////////////////////////////////////////////////////////////////////////
//	Rev. History	Version
//						5.0   Initial version
//////////////////////////////////////////////////////////////////////////////
//	Copyright © 1996-1999 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 KEYWORD = 'trace '
integer	li_keywordpos
string ls_dbms

// Check arguments
if IsNull (ab_trace) then return -1

// Check if an action is required
if ib_Trace = ab_trace then return 0

// Set trace property
ib_Trace = ab_trace
ls_dbms =  Lower (this.dbms)
li_keywordpos = Pos (ls_dbms, KEYWORD)

if ib_Trace then
	if li_keywordpos > 0 then 
		// Keyword 'trace ' is already found.
		return -1
	end if
	this.dbms = KEYWORD + this.dbms
else
	// The word 'trace ' should be found and removed
	if li_keywordpos = 0 then 
		// Keyword 'Trace' is not found.
		return -1
	end if	
	this.dbms = Mid (this.dbms, li_keywordpos + Len (KEYWORD), Len (this.dbms))
end if

if of_IsConnected() then
	// For the change to take effect a reconnection is required.
	of_DisConnect()
	of_Connect()
end if

return 1
end function

     
Name Owner
pfc_n_tr.of_copyto pfc_n_tr

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.len systemfunctions
systemfunctions.lower systemfunctions
systemfunctions.mid systemfunctions
systemfunctions.pos systemfunctions
pfc_n_tr.of_IsConnected pfc_n_tr
pfc_n_tr.of_Connect pfc_n_tr
pfc_n_tr.of_DisConnect pfc_n_tr

     
Full name
No Data

     
Name Scope
No Data