of_unregister


pfcapsrv.pbl   >   pfc_n_cst_tmgmultiple   >   of_unregister   

Full name pfc_n_cst_tmgmultiple.of_unregister
Access public
Extend of integer
Return value integer
Prototype public function integer of_unregister(powerobject,string)

Name Datatype
No Data

Name Datatype
li_cnt integer
li_functionrc integer
li_idx integer
li_rc integer
li_rowcnt integer
lpo_invalid powerobject
ls_filter string

public function integer of_unregister (powerobject apo_object, string as_eventname);//////////////////////////////////////////////////////////////////////////////
//
//	Function: of_UnRegister
//
//	Access: 	public
//
//	Arguments:
//	apo_object : powerobject ; Object to be notified
//	as_eventname : string; Event to be notified
//
//	Returns: integer
//	1 - Success
// 0 - Entry not found
//	-1 - Error
//
//	Description:
//	Removes the entry denoted by the object and event passed in.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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_rc
integer	li_cnt
integer	li_idx
integer	li_functionrc = 0 
integer	li_rowcnt
string 	ls_filter
powerobject lpo_invalid

// Validate arguments.
If isnull(apo_object) Then Return -1
If not isvalid(apo_object) Then Return -1
If len(trim(as_eventname)) = 0 Then Return -1

// Validate required references.
If IsNull(itmg_requestor) Or Not IsValid(itmg_requestor) Then Return -1

// Determine if the object is registered.
If Not of_IsRegistered(apo_object, as_eventname) Then Return 0

// No interrupts while Unregistering.
itmg_requestor.stop() 

// Find the object/event pair.
li_cnt = upperbound(inv_tmgregister)
For li_idx = 1 To li_cnt
	If isvalid(inv_tmgregister[li_idx].ipo_notify) Then
		If inv_tmgregister[li_idx].ipo_notify = apo_object And &
			inv_tmgregister[li_idx].is_notifyevent = as_eventname Then
			
			// -- Found the object that needs to be unregistered. --
			
			// Main register list - Make the object point to nothing.
			inv_tmgregister[li_idx].ipo_notify = lpo_invalid
			inv_tmgregister[li_idx].is_notifyevent = ''
			
			// Support register list - Remove the object entry.			
			ls_filter =  "index = "+string(li_idx)
			li_rc = ids_list.SetFilter(ls_filter)
			li_rc = ids_list.filter()
			li_rowcnt = ids_list.RowCount()
			li_rc = ids_list.RowsDiscard(1, li_rowcnt, primary!)
			li_rc = ids_list.SetFilter('')
			li_rc = ids_list.Filter()
			
			// Set return code that object was unregistered.
			li_functionrc = 1
			Exit
		End If
	End If
Next

// Calculate and set the new interval.
of_ReCalcInterval()

Return li_functionrc

end function

     
Name Owner
No Data

     
Name Owner
datastore.filter datastore
datastore.rowcount datastore
datastore.rowsdiscard datastore
datastore.setfilter datastore
timing.stop timing
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.string systemfunctions
systemfunctions.trim systemfunctions
systemfunctions.upperbound systemfunctions
pfc_n_cst_tmgmultiple.of_isregistered pfc_n_cst_tmgmultiple
pfc_n_cst_tmgmultiple.of_recalcinterval pfc_n_cst_tmgmultiple

     
Full name
No Data

     
Name Scope
No Data