of_add


pfcapsrv.pbl   >   pfc_n_cst_linkedlistbase   >   of_add   

Full name pfc_n_cst_linkedlistbase.of_add
Access protected
Extend of integer
Return value integer
Prototype protected function integer of_add(n_cst_linkedlistnode,n_cst_linkedlistnode)

Name Datatype
No Data

Name Datatype
lnv_nextnode n_cst_linkedlistnode

protected function integer of_add (n_cst_linkedlistnode anv_newnode, n_cst_linkedlistnode anv_insertafternode);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_Add
//
//	Access:  protected
//
//	Arguments : 
//	anv_newnode  node to be added to the list
//	anv_insertafternode The node to insert after.
//
//	Returns:  integer
//	1 = success
//	-1 = failure
//
//	Description:  
//	Adds a new node after the passed in node.  Two valid nodes have to passed in,
// the insert after node has to already be in the list.
//
//////////////////////////////////////////////////////////////////////////////
//
//	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.
//
//////////////////////////////////////////////////////////////////////////////

n_cst_linkedlistnode	lnv_nextnode

// Validate required references.
if IsNull(anv_insertafternode) or Not IsValid(anv_insertafternode) Then return -1
if IsNull(anv_newnode) or Not IsValid(anv_newnode) then return -1
if IsNull(inv_head) or Not IsValid(inv_head) Then return -1
if IsNull(inv_tail) or Not IsValid(inv_tail) then return -1

// Determine if the insertion point the Tail node.
If anv_insertafternode = inv_tail Then
	// Add the new Tail node.
	Return of_AddTail(anv_newnode)
End If

// -- Adding a node between the Head node and the node prior to the Tail node.

// Get and Validate the current next node for the Insertion Point node.
anv_insertafternode.of_GetNext(lnv_nextnode)
If IsNull(lnv_nextnode) Or Not IsValid(lnv_nextnode) Then Return -1

// Set the links between the Insertion point and the New node.
anv_insertafternode.of_SetNext(anv_newnode)
anv_newnode.of_SetPrev(anv_insertafternode)

// Set the links between the New node and the Next node.
anv_newnode.of_SetNext(lnv_nextnode)
lnv_nextnode.of_SetPrev(anv_newnode)

Return 1
end function

     
Name Owner
pfc_n_cst_list.of_add pfc_n_cst_list

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
pfc_n_cst_linkedlistbase.of_addtail pfc_n_cst_linkedlistbase
pfc_n_cst_nodebase.of_setprev pfc_n_cst_nodebase
pfc_n_cst_nodebase.of_setnext pfc_n_cst_nodebase
pfc_n_cst_nodebase.of_getnext pfc_n_cst_nodebase

     
Full name
No Data

     
Name Scope
No Data