|
of_unregister
|
|
Full name
|
pfc_n_cst_tvsrv_levelsource.of_unregister
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_unregister(integer)
|
Name
|
Datatype
|
EMPTY
|
String
|
li_NumDS
|
Integer
|
li_rc
|
Integer
|
ls_cacheid
|
String
|
ltr_empty
|
n_tr
|
public function integer of_unregister (integer ai_level);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_unregister
//
// Access: public
//
// Arguments:
// ai_Level The TreeView level to unregister.
//
// Returns: integer
// 1 = the data source was unregistered successfully
// -1 = argument validation error
//
// Description: Remove a data source for a level of the TreeView. The data source is a
// DataWindow object that will be linked to the TreeView level and used
// to populate.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.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.
//
//////////////////////////////////////////////////////////////////////////////
Integer li_NumDS, li_rc
String ls_cacheid
String EMPTY = ""
n_tr ltr_empty
// Check arguments
li_NumDS = UpperBound(inv_attrib)
if IsNull (ai_level) or (ai_level <= 0) or (ai_level > li_NumDS) then
return -1
end if
If IsNull(inv_attrib[ai_Level]) Or Not IsValid(inv_attrib[ai_Level]) Then
Return -1
End IF
// clear values in the structure array
inv_attrib[ai_Level].ib_recursive = false
inv_attrib[ai_Level].is_Dataobject = EMPTY
inv_attrib[ai_Level].is_LabelColumn = EMPTY
inv_attrib[ai_Level].is_RetrieveArgs = EMPTY
inv_attrib[ai_Level].is_Method = EMPTY
inv_attrib[ai_Level].is_picturecolumn = EMPTY
inv_attrib[ai_Level].is_selectedcolumn = EMPTY
inv_attrib[ai_Level].is_statecolumn = EMPTY
inv_attrib[ai_Level].is_overlaycolumn = EMPTY
inv_attrib[ai_Level].itr_obj = ltr_empty
If isvalid(inv_attrib[ai_Level].ids_obj) Then
Destroy inv_attrib[ai_Level].ids_obj
End If
// Unregister with cache service
ls_cacheid = CACHE_ID + string(ai_level)
If inv_cache.of_IsRegistered(ls_cacheid) > 0 Then
// already registered so unregister
li_rc = inv_cache.of_unregister(ls_cacheid)
end if
Return 1
end function