|
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
|
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