problems with AcBtree

lalachai

New Member
Hi Forumers,

In order to be more efficient in handling 170,000 records, I have been testing the AcBtree from Actuate Foundation Class. However, I have problems understanding how to use them . The help files provided is insufficient .

I have managed to put in data to the tree using the findOrCreate() method. However, all the datas inside the tree have null values

These are my source code in the OnRead() method in a DataRow Component.
________________________________________________________________________________________________________________________________
Sub OnRead( )
Super::OnRead( )


counter=counter +1 ' counter = global variable declared in bas file

temp = KUNNR ' KUNNR is the data to be stored

IF counter = 1 THEN ' build only a tree
set storeTree = New tree
END IF

DIM data AS myclass ' myclass predefined in bas file
set data = new myclass '
data.key=temp '
data.value=counter '
storeTree.FindOrCreate(data.value) ' if the key doesnt match any records in the tree, add the data to the tree

IF counter = 10 THEN
MSGBOX storeTree.FindOrCreate("4")
MSGBOX storeTree.getCount() ' this returns 10 in this scenario , meaning the tree is filled.
END IF

End Sub
______________________________________________________________________________________

the bas file is like this.
__________________________________________________________________________________________________

DECLARE
global counter as Integer
global storeTree as AcBtree
global temp as String
END DECLARE

CLASS myclass
Dim key as String
Dim value as Integer
END CLASS

CLASS tree SUBCLASS OF AcBtree

FUNCTION GetKey(obj AS myclass) AS Variant ' I believe i have overwriten the getkey method here
Dim data as myclass ' but i do not really know how this works, pls englighten
set data = obj
GetKey = data.value
END FUNCTION

END CLASS

___________________________________________________________________________________________________________________________


Apart all this, the insert method provided by the AFC is not working

eg , storeTree.insert( data ) will return this error.

" Basic Error: 37 Module: C:\Program Files\Actuate7\eRDPro\afc\btree.bas Line: 491 Verify statement failed. Do you want to debug? "

Pls enlighten , appreciate your great help.

newbie,
lalachai
 
Top