Private m_CompareType As eCompareEnum ' key comparision; cannot be changed after 1st key is added to collection. Makes keys case sensitive or insensitive
Private m_Buffer As Long ' buffer of n items (default is 10) to help prevent Redimensioning collection after each add
Private m_ItemCount As Long ' number of items in the entire collection
Private m_KeyCount As Long ' number of keys (items do not require keys)
Private m_Keys() As KeyStructure ' array of keys used
Private m_Col() As CollectStructure ' the collection
Private m_Objects() As Object ' may be used temporarily when loading a previously saved object. Referenced in LoadColllection, SetSerializedItem
Public Function AddItem(Item As Variant, Optional ByVal Key As String = vbNullString, _
Optional RelativeKeyIndex As Variant = vbNullString, _
Optional ByVal Relationship As eNodeRelationship = relNextSibling) As Long
' PURPOSE: Add/append/insert an item into the collection
' Item.{Required} Any VB number, string, control, variant, object, etc
' Key.{Optional} A key to reference this new item by. The key must be unique, can be numeric or not. Cannot be Null
' RelativeKeyIndex.{Optional} The key or index to the node that the Relationship parameter applies too
' -- If is vbNullString or zero, then the root will be used
' Relationship.{Optional}. Default is relNextSibling
' -- relFirstChild. The new node will become the first child of the node ref'd by RelativeKeyIndex
' -- relLastChild. The new node will become the last child of the node ref'd by RelativeKeyIndex
' -- relFirstSibling. The new node will become the first child of the parent of the node ref'd by RelativeKeyIndex
' -- relLastSibling. The new node will become the last child of the parent of the node ref'd by RelativeKeyIndex
' -- relNextSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its next sibling
' -- relPrevSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its previous sibling
' The following do not apply for items containing arrays or objects and will reset to relLastChild if that case
' -- relChildSortedAsNumeric_Asc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
' -- relChildSortedAsNumeric_Desc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
' -- relChildSortedAsText_Asc. If item is String, place child in sorted position comparing siblings non case-sensitive
' -- relChildSortedAsText_Desc. If item is String, place child in sorted position comparing siblings non case-sensitive
' -- relChildSortedBinaryText_Asc. If item is String, place child in sorted position comparing siblings case-sensitive
' -- relChildSortedBinaryText_Desc. If item is String, place child in sorted position comparing siblings case-sensitive
' Return value. If no errors encounterd, return value is current Index of newly added item
' Note about Overflow checks in AddItem, DeleteNode and FindKey(adding a key)...
' IMO they are probably useless. If the collection got so big as to contain over
' a million items, user would probably run out of memory first. But we make the
' checks anyway as a measure of professionalism.
Dim newIndex As Long, KeyIndex As Long, relIndex As Long, pIndex As Long
Dim vType As Integer
If Not RelativeKeyIndex = vbNullString Then ' validate relative's key/index exists
Case relNextSibling ' set the adjusted target index based on Relationship
If m_Col(m_Col(TgtIndex).Parent).Family.Tree(treelast) = TgtIndex Then
moveAfter = True
Else
TgtIndex = m_Col(TgtIndex).Elder
End If
Case relPrevSibling
' no adjustment needed; default value is moveBefore not moveAfter
End Select
If Index = TgtIndex Then ' if the source & target are same, simply abort
MoveItem = True
Exit Function
End If
' moving is a rather simple process of updating linked lists,
' the physical arrays won't be touched; their linked lists are just updated
' 1) The previous and next sibling links around the moved node must now connect to each other
' 2) the previous and next sibling links around the new node position must now connect to the moved node
' Adjust the current node sibling references
' update linked lists around this node. We will be removing it from the chain
With m_Col(Index)
If .Younger = 0 Then ' this was the first sibling
If .Elder = 0 Then ' this was also the last sibling; an only child
Erase m_Col(.Parent).Family.Tree()
Else
m_Col(.Parent).Family.Tree(treefirst) = .Elder ' the next sibling is now the first
m_Col(.Elder).Younger = 0 ' and it has no previous sibling
End If
Else ' make this node's prev sibling reference this node's next sibling
m_Col(.Younger).Elder = .Elder
End If
If .Elder = 0 Then ' this was the last sibling
If Not .Younger = 0 Then
m_Col(.Parent).Family.Tree(treelast) = .Younger ' the prev node is now the last child
m_Col(.Younger).Elder = 0 ' and it has no next sibling
End If
Else ' make this node's next sibling reference this node's prev sibling
m_Col(.Elder).Younger = .Younger
End If
End With
' Adjust target position & its sibling's References. We will be inserting into the chain
If bNewTree Then
InitializeTree TgtIndex, Index
m_Col(Index).Elder = 0
m_Col(Index).Younger = 0
Else
' now adjust the target node's siblings/parent linked lists
With m_Col(TgtIndex)
If moveAfter = True Then
If .Elder = 0 Then ' was last child; moved node now is
m_Col(.Parent).Family.Tree(treelast) = Index
Else
m_Col(.Elder).Younger = Index
End If
m_Col(Index).Elder = .Elder
m_Col(Index).Younger = TgtIndex
.Elder = Index
Else
If .Younger = 0 Then ' was first child; moved node now is
m_Col(.Parent).Family.Tree(treefirst) = Index
Else
m_Col(.Younger).Elder = Index
End If
m_Col(Index).Elder = TgtIndex
m_Col(Index).Younger = .Younger
.Younger = Index
End If
m_Col(Index).Parent = .Parent ' set the new parent
End With
End If
MoveItem = True
End Function
Public Function MoveChildren(ParentKeyIndex As Variant, TargetKeyIndex As Variant, Optional ByVal Relationship As eNodeRelationship = relNextSibling) As Boolean
' PURPOSE: Move a node chain from current position to a new position and possibly a new parent.
' ParentKeyIndex. A key or Index to reference the parent node by
' TargetKeyIndex. The key or index to the node that the Relationship parameter applies too
' -- If is vbNullString or zero, then the root will be used
' Relationship.{Optional}. Default is relNextSibling
' -- relFirstChild. The new node will become the first child of the node ref'd by RelativeKeyIndex
' -- relLastChild. The new node will become the last child of the node ref'd by RelativeKeyIndex
' -- relFirstSibling. The new node will become the first child of the parent of the node ref'd by RelativeKeyIndex
' -- relLastSibling. The new node will become the last child of the parent of the node ref'd by RelativeKeyIndex
' -- relNextSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its next sibling
' -- relPrevSibling. The new node will be inserted between the node ref'd by RelativeKeyIndex and its previous sibling
' The following do not apply for items containing arrays or objects and will reset to relLastChild if that case
' -- relChildSortedAsNumeric_Asc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
' -- relChildSortedAsNumeric_Desc. If Item is String or Numeric/Date, place child in sorted position comparing siblings as Numbers
' -- relChildSortedAsText_Asc. If item is String, place child in sorted position comparing siblings non case-sensitive
' -- relChildSortedAsText_Desc. If item is String, place child in sorted position comparing siblings non case-sensitive
' -- relChildSortedBinaryText_Asc. If item is String, place child in sorted position comparing siblings case-sensitive
' -- relChildSortedBinaryText_Desc. If item is String, place child in sorted position comparing siblings case-sensitive
' Return value. If no errors encounterd, return value is True
Dim moveAfter As Boolean, bNewTree As Boolean
Dim Index As Long, TgtIndex As Long
If m_ItemCount < 2 Then Exit Function
' validate ParentKeyIndex and TargetKeyIndex
Index = ConvertKeyToIndex(ParentKeyIndex, True)
If Index < 0 Then
Err.Raise ERROR_INVALID_KEYINDEX, "Collection.MoveChildren", "Invalid Source Key or Index"
' loop thru changing the parent of all moved children; changing Parent ref
Do Until Index = 0
If m_Col(Index).Parent = m_Col(TgtIndex).Parent Then Exit Do
m_Col(Index).Parent = m_Col(TgtIndex).Parent
Index = m_Col(Index).Elder
Loop
If Relationship > relLastChild And Relationship < relChildSortedAsNumeric_Desc + 1 Then
' simply ensure tgtIndex's children are sorted
SortNodeLevel TgtIndex, (Relationship - 6 + (Relationship Mod 2 = 1)), (Relationship Mod 2 = 0), True, vbNullString
End If
MoveChildren = True
End Function
' PURPOSE: Get/Set the value of a collection item
Public Property Get Item(KeyIndex As Variant) As Variant
' KeyIndex. A key or Index to reference this item by
' - Cannot be vbNullString nor zero
' Note about referencing items that contain arrays.
' If I wanted to reference the 5th array element of an array contained in Item,
' my code would look something like the following.....
' Debug.Print myCol.Item("KeyOfItem")(5)
' for Items that contain arrays of objects, then we could use something like
' Set NewClassObject = myCol.Item("KeyOfItem")(5)
' or if you wanted to view the value of a Public class property named Misc...
' Debug.Print myCol.Item("KeyOfItem")(5).Miscd look sometplies too
operty namedotargepn't End If
End With
' clear the old family.cingarrays ong Parenst up If long Parenroperty named; neit/s
sObject C 2 = 0)onship < The following do n(ef
ndex. The his ling is the targeult is sObject Cdex) ne MoveChi&efeu) ne Move siblings&ects, t=de parent of t is sObject Cdex) ne MoveChi&efeu) ne Move siblings&ects, t=de parent of t is sObject Cdex) mily.
Sele ne MoveCleme End MoveChi&efeu) neto refeao..
'relFirstSief new s last
's prev Agirst child; now new tree Exit Function
End If
eTrue
Exit Funeeitherent of t is in arrat is irrrrrrrrrrce parents End With
' d WiahO, newIn End es
With m_ic_Desc + 1 Then
eldSortedAsNumeric_Desc + ,e-sensue, v hWiahO, newI,K ' the prev
With m_ic_De Endroperty namerelFirstSief ildSsObject C 2n ' my code would o his x
End If
tmyCot = m_Col(e preA
)l(m_Col(Index)Invalid Destination Key or nsue,ild; If mibling ' (Append To End)rent of the to((((((((((x)
tmyCot = m_Col(e hptmyCot =y: ldSortedAsNumeric_Desc + 1 Then
' simply ensure te abx) mi ldSortedAAAAAAAAAAAAText_Asc. If te ab=next sibling ref new tree)lFd IfBF 1)), mren=======r simply ast) = m_Coeee)lFd IfBF 1)), tmyCo asitive
'o asitiveIf
aAndex) si v ly eleme next siba====r simply ast) = m_Cla#ing
get are satherent of t is in arrat is irrrrrrrrrrce parents End With
' d WiahO, n If Tg
obfaationsh)I
End Funch End If
' new tree's last sibling'd De
laveCiblinSortedAsNumeric_Desc, relChildSortedAsTeleme next End W EndrolIf I.ce parents End With
' d rtedAAAAAAAAAAAATeo(treelast
End ux).Elder
d If
tmyCot = m_Col(e hptmyCot =y: ldSo
' d De
' uroperty name
t).Family.TrfBF nsuct Cdex)operty na name
AAAAText_Ascve
'o asu) ne wy.TrfBx's fami ===tFunction
<aswiCol(.Eldeqc_Desc + 1 Case rel tmyCot = encounterd, t =ulIf I.ce parents E name 1)), FHtmypL Ibjectk), True, vbNu4 )operty na name
AAAAText_Aseqc_Desc + 1 Caisitive
' Re With m_ic_Den' vWith
'
AAAAText_Asem -- relChildSortedAsText_Asc. If dexan array contained inNumeric_Desc + 1 ThencoIbj End HH TgtIndex E 'o asitareObject Cdex) ne Mov.Famiirrrr If
areObje the fol. nsuRRRRRRRRRRRRRRRRRs hat con uestel(TgtIndex).PaPardde would o his x
v.lIftmypL Ibjectk), Tne rences. We will be inserting iniring or Numeof tvalue of a ach otherP or Numeoevel unc'i amily.Tree(tree'oeoevelo.Sannotl be C
sObject C 2 = 0)onship < The following do n(ef
ndex. The h m_Col(m_Col(_Col(Index).
Else
I
bjectedAAAAAdd ux)C m_Col(m_Co ux)C neto n(ef
dex).FatWith
ndAAAA-, ndAAAA-edAA ol(m_Co ux)vtIndfNEal}. Dei = .Yok someh m_tion
dexan array contained inNumeric_Desc + 1 ThencoIbj End HH TgtIumersText_Asc. If dexanIbj End HH m)O, newh m_ic_Deuncldren are so( 'o a_Asc. If dexqidd ux)C 00 Tic_D Elseperting iIf dexan array contained inNumeric_Desc + 1eitar ,d
serted between -,een - inNumert_Asem )If
eric_Descmd f(R,
C )Ifoamimove.
u(my contained inNumeric_T m_Colwem
Public PropergM arraysx = 0em
Puba Pu(my contained inNumeric_T m_ColwtiorgM Index to referencey End If
reref'd by ,d .9999999999999999s String or Nis in arrat
o( 'o r&pL If Not m TgtIndex E 'o Et eol(e hinsuRRRRRRRRRRR= Ge
debMbElder = newIndex ' fwd index
m_Col(newInd - 6 + (AsText m_Col(new1
PuofNEal}. Dei llString
/HH Tgt s non catring
/HH Eal}. Dei llString
Youof a ach ov
Whdexan'
ECnm2gtc. Ig
String or Nistring
inding is a ra Str'o rhis x
m_Col(.ec_Desc + 1 Caidex = m_Col(Index).El(Ind Youof a ach ov
ncldren a , Inlo Et-
nclt-
nd - 6s m_Col(.ec_Desc + 1 oe child in sorted po m ) Endroperty
ncldren a Im Familsc. Ift Cdextion
PPPPPPPPP_Col(new1
PuofNEal}. Dei llString Puo kgllString
PuofNEa 2 = ePPPPPP_Col(new1
PuofNEal}. Dei ll}. Dei = .Yoe(Ind Ypal(Index).Key = 0
1 Caidex = m_Col(Index).El(Ind Youof a ach ovnew1
TgtIndex
HH m)O, n' fwd index
E ' PURPOw1
Cndex).Key = sNumericturn value is True
PuofNEal}. Dow nertedAsTsuRRRRRRRRRdexng. Theiuarget ao) 1 Caiding like the followinmx).El(Ind
ions kchi
End Sol(pI
seld i Sol(p ===tFunctioniahO, ney2d
ionsho TgtIndex
HH mn' fwd (nt
SortNodeLevel TgtIndex, s True
PuofNEal}. Dow nertedAsTsuRRRRRRR
i ioship As eNodeRelationsE ' Dim Index As Long,El(Inrue
PuofNEal}. Dow nertedAsTspc_Desc + Dim Index As Long,El(Inrue
Puef tar d, return va
ncr EndringFrom4me next En occol(.ec_doccol(.ec_doccoringgc sibliup do n(ef
--E TgtIndex =ooooooodAsTspc_m
P.ry ens k.Family.Tree Do UntiiiiiiiiillStrin --E ethi/ccor slI If item is wex '6 + (ReF End I , ve
o his x
, Inng.ec_ertedAensurInng.ec_1 DoS(.ec_Desc 'd eole
im Index A , Inngan array co kte llStrinx '6 + b'gx Ailyr(.ec_Desc 'd eole True
ioshrii - 6ex = GetChil As LrtedAensurI
PuofNEal}. Dow nertedAsTspc_Desc + Dim Indor if yontained inNumeriudexirtedhsibling'n arrays.
'g'n arrays.
w neray eossTspc_Ddexes
, n' fwd index vedexeg'n arrd index ces. We will be0n ara .99(Append e them is wex '6Lef tar d, return va
ncr vedexeex
, return va
ncr vekkkkk ing, pS m pS mexeex
As leelas m pS mexee Puef tar d, rrt_Asem )elasl(.Parent).Familry ens Ce
o his x
, n)Indesem )elasl(.Parent).Familry ens tIndex, s Truenshrii Ceux)C
l ' thCog it from t n va
ncr velry ens tIndex, s Truenshrii Ceux)C
l ' thCog it t,ce, s.srdes and changegs as Numbers
' -- relChildSortedAsTex(aIndor if &inx '6 gx(aInds Er )elasl(.Pareruenshrii ' -- relCkis x
, Inng.ec_positi , ngs as Nusb
4 te m_aIndor if &inx '6 gx(aTruenshrii Ceux)C
l ' thCog it from t n va
ncr velry ens tIndex, s Truenshrii Ceux)C
l ' thCog it )elasalidatsCeuo + 1 oe chil n va
uens child n i h - Cannot ,t=o , return va
ncr lect Casenx '6 gx(aTruenshrii Ceux)C
l ' thCoing. The n (AsText If bNx, s Tru m_Col(Index).Family.Tree(treelast)
Index = m_Keys(FindKey(sKey)ollStrSortedAsText_ronsh looktIndex).ly. n va
atiry mchisu,f tar d, r,xan array contaLsCol(e(tr-esc2 = 1))lFd IfNparound the new node pos h - Cannot ,t=o , return ke th ....rx '6Lef tar dt If brii Ce- reuuenshraLsCmndex).ag it ) If Ind o) o) o) otar dt If brihCoing. parentIeve'd eol'ndex).Pare'd Ceux) t,ce, sined inN..rx '6Le.Parent).Familp < The foSortedAsText_ronsh looktIndex).ly. n , g. parentIeve'd eol'ndex).Pare'd Ceux) t,ce, sined inN..rx '6Le.Parent).Familp < The foSox).ag it ) ers
' -- relChildSortedAsTex(aIndor if &inx '6 gx(aInds Er )elasl(.Parer the eri"c sibliup do n(ely.cin ve
ewKey As String) -- rel(aInds E ' or if yomilry ens tIndex, s T mexeex eol'ndex).Pare'd Ceux) t,ce, sint Casenx '6 x
H ction.m Index ing
i Index ing
eole
( 'o Puoyounger ref'd e them is wex '6Lef tar El(Inrue
i ).Famcif sxt En occol(u'd eIndexIndexIndext tar d, r,xan array contaLsCol(e(tr-esc2 = 1I E nam(aInrue ab=ee ab=ays l(Inrue
tn occol(u'd eI.cin
tring bjectk), Tne rexan'
rofNEa 2 = ePPPPPP_Col(neric_Asvvvvvvvvv
tn vvvv n vvvv er = m_Col(7lIIIIII Cannot ,t=o , return ke theturn ke thetuSortedAsTex t,ce, sined inN..array contaLsColov er = m_Cob/in sor Fun eturn ke tned inOw1
Ctor if &d; If mi Otreel0 er =aeric_Desc + tInde = m_Col(e preA
oo
opertyb ' RA 00 Tic_D erico mns child n i h - Cannot ,t=o , return va
Err.Raise ERRORsa.dLef taf ex)mi rgetKeyIndortedAsText_Desc. If iuPshraLsCmndexovskIndex o siblings as Numbers
' -- relChildSortedAsTex)lFd IfNparoun FHtrr n) ' thCog it)lFd If) , n' fwd iv
' = Convert(e(tr-esc2 = 1))le1o
a ' thC Unert(e(tr Fa po d inN..,,x''t.Ra)fNEa if vDit )ta)se Do Untc sortlDesc. u
f v
Vox Inrue
ria v
Voy T
rofe(Indurn ke tned inio) CT mexeeh0 T/6Lef ta-- relChi Do Unto Unto Unto Mo ' -- ta--iv rents ' m CT mexeeh0 T/6Lef o Unto Unto Moa is not new tre ' -- ta--iv rents ' m CT mexeeh0 T/6Lef o Unto Unto Moao renkthe nocmp pocp
(aIT FHa dSorted foox ing y thCogThen
po m ) Endropertex'''''ria d inio) Pe s sis 1))lFd IfBa ti= 1)), (Relationship Mod 2 = 0), True, vbNullString
ppppppis 1))lR'r 'CTrue, vbNu4 , place child in sort the 'o Puoy m_Col(ndex) siex As LonO1ra Str 'CTrue, vbNu4 End u Conve sort the 'o ctk), -- IXeld dhsWndex LonO1ra Str 'n the nocm1ra Str d 'r = .Younger
d 'r = .Younger
ger
d 'r = .Yu 'o Dim moveAxan'aFaIxan'aFl Caide sort eCol(.eolde IXeled foox inwe liR x
m_Coll= .Yue, vbNull
riNCTrue, vbNu4 ,
ppppppio adjustment needed;ppppsorteeeeeeeeeee
he itedn vg'd D
'2iveI
is wex tk)tneeded;pppps tmNum9sibling dn vg'dAed;pppps mi i an'
ve is )ex''''''ed nodeNAthe chain
Wc m_Col(IndDort aouod CnCuld neux)Coy o m_Coll= mNum9smily.Tmily.Tmily.Tmily.Tmily.Tpw eole
e i m_ux)Co (we T ol(reNu4 ily.Tmily.Tmily occol(u'ddnexily.Tmily.Tmily.Tfmily.Tmily occol'r = .Yn , re 'CTrue, vbNu4 E m(i an'
ve is )ex' = .Yk)ex' = .Yk)eTmileeeeefNf dhKy occol(u'ddnexily.Tmily.Tmily.odeAsc. ove g
m(i an'
f dhKy objectedAAAAtlyr(.ec_Desc 'd .dAAAAta_Desc 'd .d End Numeric, reDei ll}. Dei = .Yoe(Indate Oi eAsc. ove sc ',te Oi eAsc. op TgtIndex =eDei ll inN..rx reDei leva
' PUndurn ke taPV If esc,pio adjustment nemitivemio adjustmeno -- IXeld '2iveI
rC1ce childedAsT ' thCog it from t n va
n.-,m(i ax)Coy vbNu4 o his tmNum9siblini 0
1 Then
linchipppps tmNum9sibg C 1pfevURPOSux)vtI4 Eini 0
vedURP linchioex' = .Yk)ea
ueeTmilee )open the nV'dhKy objet(n'
rofNf d o Puoy sTmily od nodes tgtIndex).Familllllllllllllsef ta-- relChi Do UntNu4 E Ia+he g. paag ue, vbNSE:c,pio adjustment FHa an'
r)opppppdURP linchioex' = .Yk)ea
ue reDei ).FamDen eturn ke tned'r 'CTrue, vbNu4 , place child in sort th'CTrue, vbNu4 , ue reD ' m oo
ue rernt).FappdURP linchioex' = .Yk)ea
ue pamDen eturn ke tned'r 'CTrue, vbNu4 , place child inm(i.Youurn value is eturn k relld, ndex, s Truenshrii bl(Index)ag d EndEtned'r(Inde , siblingkedcp eturn ke tned'r 'CTWurn valdx)vtI4 Eini 0
vedURP lue, vbNu4 , ue reD ' n.-,mvedURP lue, vbNu4 , us child n i h -bne & tar sKey = RandomKe Rand Index inadjustmenoe g
--iv rexh -bne & tar tIndex, s T ndexxxxblingsEini 0
ved'd .gndohi Do UntNu4stmenod nodes tgtIndex).Familllllllllllllsef ta-- relChi Do UntNu4 E ,.bg C nod nodes tgtlChi Do U Ran do Nu4stmenod nodes x tk)tneedel*d Index ides x tk)-bne & taran do Nusu,f tar d,e chil reD he 'o ctk), --enterd, t =ulIf I.a RelativeKeyIndex and its next sibling
' -- relPrevSinodocddo
ue rernt).FappdURP linchbliterdlativeKeyIndex and fNEKRP d nodes tgtIndeln.-,mvedURP lue,POSux)vsTspc_man'
ved nodes eld dhsld n i h -bne & ta)ronsh lookf Ind hsld rdURPI.a& ta)ronsh l IXeld '2iveI
rC1ce cnde-,m(iont.Parent).Family.Tree
arent).Family.Tree
arent).Family.Tree
arent).Familyde liR x
m_Col(.ec_Dv
Nf dhsld x tk)-bne & t Cdex h -bne & ta)ronsh Unto Unto Mo -bne & an'
r & an'
r ndex).i) .Yk)exkumeric, tNu4 E . (Index).EldEnd With
ds 1))lR'r ronsh lookf Ind hsld rdURPI.ab)Coy dext tar d, , ont.Pa rty i6elatio nodes tgtlChi Do U Ran do Nu4stmenod nodes x tk)tneedel*d In m_Col tree's da/r Nf drteeeeee'd Cdexne & ta)ronsh nodx).Fami Dim moveAxan'af dhslder A-, return(ux) d nodes's da/r Nf ds next sio2wsibg ta)ronsh noeKeyIndSortedAAAAA'
f oyqmNf drteeeeee'd Cdexne & ta)ronsh nodx).Famie just updatedeIndex(Pan Unto Unto MedAAta)ronsh Unto Unto Mo -bn'd .gndohi Do UntNu4stmenod nodes tgtIn
rero UntNu4stmenod nodevd rdUR tar d,e chil reD he 'o ctk), --enterd, t =ulIf I.a RelativeKeyIndex and its next sibling
' -- relPrevSinodocddo
ue rei Index Before not moveAii Ce- ]'( Ce- ]ndexA dhKy ]ndexA do
ue rei hi Do UntoooooooooooooooooooooooooooTmily.o'. t Co UntmoveAxb) do
ue rei hi Do Un tte Oioionsh)I
End Funch End If
n i h -bne & ta)ron0Vd nodes x tk)tneedel*d In m_Col tree's da/r Nf drteeeeee'd Cdexne & ta)ro dhKyc,rcrrtIndex).Famiey or Insoa
pnO1ra Str pocE
e & ta)i hi Do Untoooooooooannt niri"c sibliup soooq4 soooq4 soooq4 soooq4 soooq4 soooq4 sothi/cceld dhn node .oooooooooannt niri"c sibliup soooq4 soooq4 soooq4 soooq4 soooq4 soooq4 sothi/cceld dhn node .oooooooooannt niri" ex.Rd in) c1it i Index).KeaAn Fun eturn ke tned inOw1
Ctor if &d; If mi O Indext mex'6Lef tar Ev tIndex, s1nean
d 'r =T n8stmeno s'r Cdex) nodes re chimi i Sox).ag it ) ers/r Nf drteeeeemily.Tree(tre1d,e ch vvvv chi)fv 'apply for it rhis pppp Nusu,f Mo -bn'/ IfBa ti=t m_ColeyIndex and its next sibling
' -- relPrevSinod'
ved nodes elawhimi i an'
ved nodes eld dhiIo uveAxan'aFam
'appl uveAxan'oorFami ndAau
n i h -bne & ta)ron0Vd nodes x tk)tntInde d sKey s'r = .Younger
d 'r = .Younger
gerLl'ts chil reDeefirst)
elationship e ch vEMo -bne & Younger
ger)oes x sh UndhKy objuveAxan'x) nel'ts choooq4 soooq n i an'
vEMo -bneer
lookf 4 soooq4 seI_1 DdAsText_Desc. Iby ,d .999h1PPPPPPPPPPPPPPPPPPPP ric_Asvvvvvvm.sCLi PPPP ric_Asvvvvs m_Col na 1l eemily.Tree(tra d E"nocext sio2wsinch
nc"d...vo'."nocccol(u'ddnee(tAsvvvvvxa4 soooq4r'r Asvvvvvxaoooooooan.vn vvvv re m_Col na 11r) = . 11r) = . 11r) =& Young iniringr = .You"Y na lYounger
Youn ildyde vEMo -bneer
loos You re m_Col na 1BF 1)),uPP rsc, re rn l(u'tex' etl(u'tex' etl(u'tex' eip e ch vEp soooqes tgtIn
rei e i m_ux)Co (we T ol(reNu4 ily.Tmily.Tmily occol(u'ddnexily.Tmily.<i ' r'2ivek4ildrend tk)-bnerle1d,e& em") =T n8stmeno s'r Cdex) nodes re chimi kdne 'o ctk), --enter.Tree(t0 kdne 'o ctk), --
' or 'n the nocgf t,,,,,,,,qwald d sKey sStrSorte -bneerp(KeyICounterd, t =ulIf I m_ux)Co (we T st
)tIn
rmi Do U Ran do gs (Index).EldEnd WisIf Item dAly.Tdtefirsturn)ecteno sirsturn) was last ch) soooqes t mtc), h
Aa rather simowterd, t =ulIf I 3se/iblingkedcp ounger
urn) was las =T ger
urn) was la next sibling
ir d, r,xanConvert(e(tr-esc2 = 1))os 'drCol tree(.Parent).Family.Tree(tp4 soooq4r'r Asvvvvvxaoooomexeeh0xt tar d,vvxaoooomexneerw1
Cehe fwx' exCdex) neP lincly.Tmily occ sKey sSag ue itoq4 soooq4 soooq4 soooq4 soooq4 soooq4 Sdy sSag u mioq4 so/i i Index).KeaAn Fun eturn ke tng u mioq4 so/i i Index).KeaAn Fun eturn ke tng u mioq4 so/i i Index).KeaA i.KeaAn Fun eturn ke tng u fn l(u'tex' etl(e ger)oes x efault is relNexr = .Youngeov rexh -bne & tw i.KeaAn Fun ging the parent ofaYoeAxan'x) nel'ts choooq4 soooq n i an'
Bly.TminfBae parentddnean'
c"d...vo u mi ke t Eb was lasinV'd t parentddnean'
c"t(d Select
Chi Damsh l IXeld 'rhis pppp Nusu,f Mo, s Truen) ke tnCe, vbNu4 , place child i Tr
sStrSorte -bneerp(KeyICouna inNesk chi = Convy.oConvy.one rea exCdex) neP eero sParent).Familydneann va,1 geup'Ply.Treild; now newm_C_Col(TgtIndex).Parent Then Exit ldDo UM is dneaninchi Fun eturnt
' uroperty nasvvvvvxaooooooo k.Familr 6 xnnnnnnnnnnnnnn now reexily.TmgtInD'r 6 xnnnnnnninchqeisewm_C_Col(TgC
eturnteunnnnnnna) tar nTrdevn1 exCdex) lExit lq4Iefore c_Desc +h -bne & ta)ronnnnnnniPlite>e 6 dhiIo Numeric, reDei mVr 6 xne c_Desc +h -belast) = IndstInly for it rhong,x).Parent ThentiPlie va
, vbNen a e ')l 1))hi hily.Tmily.<i 0 i an'
ved nodese tng u ms uveAxan''appl uveAxan'oorFamigteyIndex and ly.<i 0 n'
ved nodes ldde woud
rmi Do U Ran do gs . (Index).EldEnd With
ds 1))lR'r ronsh lookf Ind hsld wdng uSibe>e 6 xneero x, s T )Do UM is dneaninchi Fun eturnt
' uroperty na eol(e hid node00000Rw(c,o000un giW). xneero sPa and lyawdrero Ui ke t l:bn' sPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaDn pppp N csk chi = Convy.oConvy.ndexA doooq") =T n d 'r = .Younger
o Ui knaaaaaaaaaaaaaaaang C 1pase reiW).on0Vd nodesinUR <i 0.aaaaang C 1pase re Do U Ranor it rhooooooooooog
ilaaaaaaaaaieGrtovvx/0000umeri Do U
PublidstInlyeedel*d Index ides x tk)-bne kna
S +hbne knExiiAdm)exkumeric,,r00000Rw(c,o00000000000000 soooq4 soooqytae reiW).on0nship M--------- kIndexDo UM is dneaninchi Fun eturnt
' uroperty na eol(e hid node00000Rw(c,o000un giW). xneero _o00000000000000 x . seovvlIf In'er)x ides x tk)-
Dim mo1))h seovvlIf In'er)x EExit lq4Iefore ce etuei Fun eturvxaoooomexneerAsText If bNx, s Tru m_ x).Parent ThentiPliee=vlIf In'er)x EEx )operty i6elationsr Ntt -- ta--iv dm)exkumeric,,r00000Rw(c,o00000000000 ic_DestvvlIf Io>cx t:temCeA doooq") =T fn Fun eturn ke tngic,,ronvy.oCo eturnniPlite>e 6 h- ta--insue, v hWOevSinoericnee(treelast) = m_Col(m_Col(Index).Parent).Family.Tree(treelast)
End If
m_Col(Index).Younger = TgtIndex
.Elder = Index
Else
If .Younger = 0 Then
' target was first child; an'
ved, rer = 0 ThCYou
Endxb)nt
' ureelm_Cole a Thenant nemit,ily.Trey.Trey.T <i 0. Endxb)nt
r m_Col(Indexonvy.one mment).Family.Trenwt ch) soooqes t 4Index
its next sibling
cETeKeyInurn) wa exan'
rofNf dhslder
reelastt rhis ptedBinaryText_Asc. If item is String, plBS itThentib)nt
-- relP Dim aaaaaan2 = ePPPPPP_,000000 geup'
rof ldde woud
rmi Do U Ran do gs . (Index).s
i (In = 0 Then
. 11rliee=vlIfs ptedaaaaa . (I).Parent Thentl If .Yourhslder
wmily.Treeeeeeee+ (ReF End I , veLnarylast) = Index
lings&&&&&&&&&&&blid Soux).s
geup'
rof ldde woudduarget ao) 1 Caiding like the folleDei ll is
i . eturn ksedaaaaa . Soux).s
"oarent1r simow'r,1 geupI 1))o0000Rw(c,o000) si ))o0000 Ind Io>cx t:temCeA doooq,Ening
cEexneerw1
Puxchipp et d, r,xanCo)I ) relP Dim aaaaaan2 = ePPPPPP_,000000 geup'
rof ldde woud
rmi Do U Ran do gs . (Index).s
i d;pbInda . (Inde Do U RTR)o gs paag ue,1)oes x efault is relNexr = . rei ta) (Index).s
nd If
reref'd by ,d :temdns
Apar,oood lr nd I mod I , veLnarylf lExit lq4Ieforeel = ePPPPPP_,000000 geup'
rof ldde woud
rmi1e cing U Ran dex = m_Col(Inovw = m_Coi dhiIo uveAxan'aFam
chimi i an'
ved nodes eld dhiIo uveAxan'aFam
chimi i an'
ved nodes eld dhiIo uveAxan'aFam
chimi i an'
ved nodes eld dhiIo uveAxan'aFam
chimi i an'
veoq4 dexteeeeee'd Cdexne & ta chil ruoood lr h vbN=T Chi Do UntNu4 E urn k .Yourhslder= ePP('sw chil ruoood lr Raouod CnC,aa rmi Do U Rvv er = m_Col(7x.vo'."nocccol( so/eld 'erP or Nums
"Yggggggg
chimi Do U Rtl l reD he Oe Oe Oe Oe O 7x.vo'.fenti,00000dde woud
r ' rev iauThentibF End I , veLncAs0 ePPPPPPeld 'erP O e chil reD hehU Do U RTR)o gs p(ne knl N csk ch.ne knrUnto Untomily.TreePaaaaaaat) =aaaaaaaaYoungernto Cvvvs i an'
ved nodes eld ke tned'r . uWisIS"nocccol( Oe Oe O 7x.vo'oy na eol(e hid node00000Rw(c,o000un giW). xneero _o00000000000000 x . seovvlIf In'er)x ides x tk)-
i d;pbInda . (Inde Do UUSoux). child n sKey s'r) 7x.vo'eD hehU Do U RTR)o gsiveAxan' n sKey s'rimi U Rv(l0000000000000000000000000000000000000000&en Exit ldDo UM is dneanin000000000000000000000000iy Raouo True Tr rof ldde w000dde _ily.TmilygtIndex, i ld ke vEp sooo Bly.TminfBae pdccol vEppppppp;000000 Dit En (c,o000un giW). 0000 Dit En (c,oveLnarylfol( w000dde _ily.Tm EExitxdde crodest i U Ran 1ole a Thenana0000000000000000000000s i d;pbInda . (Inde Do U RTR)o gs paag ue,1)oes x efault is relNexr = . rei ta) (Index).s
nd If
reref'd by f .Younger =dex).se1d,e& em") =T nu,000000000Rw(c,o000un gLric,,r00000o U Rvv e 7x.ddeK 'n thpt
' lt is relNexr = k), --
' or ' 'n thptbInda ovvlIf In'er)x ides x tk)-
i d;pbInda . (Inde Do UUSoux). child n sKey s'r) 7x.vo'eD hehU Do U RTR)o gsiveAxan' n sKey s'rimi U Rv(l0000000000000000000000000000000000000000&en Exit ldDo UM is dneanin000000000000000000000000iyinodes res'ruba Pu(minodes res'ruba Pu)slknl N i U ,00000000000000000n thp sDo U RTRNums
4 'oit )ta)nAi amilynnn now reeigtIn). xne000n thn thpasDo U Ditmd nodesg us x e (c,oveLnarPPeld Ehimi RTR)o gsiPeld eDo'eD heer )slknl N i U ,000)Key s'rPPeld hpasDo Uhp sDo UthpasDo UhpasDo Uhp sDo Uthpas reeigtIn). x Pp4 si&bIn = In('
rrelNexr = . rei oq4 0000000000000000002ldde wd i/e pdccosg
'urn ke tned inSex'''3000o U Rvv e 7x.ddeK 'n thpt
' lt is relNexr oq4 0SofaYoeAxaS. rei A i an'Do UhpasDo Uhp sDo Uthdu)r nTrdevn1 gTvvlIf In'anin00000000TvvlIf In'anin00000000Tvvl-
i d;pnt nemitg
Youof a a Ex nTrdevn1 gC 4 si&bin00000000Tvvl000Tvvl-
un stInly for it rhong,x).Parent n0 linusrgs&&
neec:Ac ' make tgneerw1 c ' make tdeK gs paag ue,1)oes x efault is relNexr = . uveAxan'aFam N i U ,000)K 7x.di ' make new trU ,000)Key s'rPPeld uhe fwx'ult ideK eDo'eDg'aFam N i U ,In('
prP for iIn'anin0000000ma eDo'eDg'aFam N i Uiue pdcT-ly for it riDo'eD heer )slknl N i U ,000)Key s'rPPerelNexr i U ,In('
py en) t:temCeA cT-,m N i Uiue pdcT-ly for it riDo'eD heer )slknlg si&btion
Oex).Younger =ao
rhiIo ios that contain arrays of objects, then we could use something like
' Set NewClassObject = myCol.Item("KeyOfItem")(5)
PPerelNject = myCol.Item("KeyOfItem")(5) veLrt NT)ntain w(c,o000un giW). xneero sPa and lyawdrero Ui ke t l:bn' sPaaaaaaaa0ma eDo'eDg'aFam N i Uiue pd0&ene new ao -
dcT-ly eu) neto refey obje4r'"o neero sPa an('
prs choooq4 soos eld dh .Eldp nc,o00oserelNjccol(kadjustment nemitivneero' make t00000o neero sP End i 0linch00oserel1emitisWitg
' p - 6 xneeremsVree
nc"d...l.It0000002neto refeyefault oa an('
prs choooq4 i2ing likecT-ly eunch00oserel1000dde make sdh .Eldp Fam N i U ,0c6000000000000amily00TvvlIr.Petem")(5. xneero sPa000000ahoooq4 soesfor iIn'anin0000000ma t00000o neero sP "R End ux).o.Tdi ' mau)Keyaon0nship M--------- kIndexDo UM is dneaninchi Fun eturnt
' uroperty na eol(e hid node00000Rw(c,o000un giW). xneero _o00000000000000 x . seovvlIf In'er)x ides x tk)-
Dim mo1))h seovvlIf In'er00un gnTrdero k)-
anin0000000m t000er00un gnTrdseovvr pdcT-ly for it riDi0000Tvvvvvvvvvvv(Relationl't00uer00uryText_Asc. ides x tk)-
s dneao i neto 1 Caitly.m i nake tdeK gt is relovvvvao io rvao au)Ke End If
m_C ' vwlvvvvvvv(Relationl't00uer00uryText_Asc. ides x tk)-
o2f tabdex < 0 Then giW). xneerox).EldcyText_it riDi0000Tvvvvvvvvvvv(Relationl't00uer00uryTK gtor itd uhe frodestux).o.Tdi ' d inSee woud
rmimI Fam .ce ,ou lenwt ch) s is relovvvvsf Ini FpreA
ootThen giW). xneerox).Err (She fro x 'ox).EldcyText s x tk)-
mAi amilynnn FpreA
wdrwlvvvvt ) IU ,a000000Tvvl-
aaaa sooma eDo'i d;pbInda . aultpdcT-lyely.Tm EExitxdde crodest i U Ra)l-
et gsiv
reref'reref'reht gsiv
reref'reref'reht gsiv
reref'reref'reht gsiv
reref'reref'reht gsiv
reref'reref'reht grodesce nev
reref'rer: f'rehHe i d;pbIndaa = m_Col(ey'reht ,iv
reref'reref'vs et gsiv
rerefrgsiv
reref'vvao Ntar d, bInda . aultpdcT-lExitxdde crrtc), : sPtd uhe Pu(minodes res'wm_C_Col(TgCere ere ere ere y i 1 Caiding likeun giW). n now 1 Caidin tk)l io rvao au)Ke End If
re ere y i 1 Caiding likeun giW). n now 1 Caidin tk)l io rvao au)Ke End If
re ere y e ere yld dh .Ell io rvayawdresOUntoooooooo C nod nodaAn Fun aAn Fun"d...ves rese ere yg0000o .Ell io rvayawdresOUntoooooooo C nod nodaAn Fun aAn Fun"d...ves rese ere yg0000oua m_Coi drvayaumeric, reDei ll}. Dei = .Yoe(IndatExitxdde c gerd...'y ude gtIndex = ConvertKeyToIndex(Ta au)Kex(Ta a re xneerox).Err (Sheex(Ta asvvvndexldcyTexurnhdu)r nTrd T y Ir: f'r, i U rPPeldxtDI).on0nsho t:temCeA cT-a En;f4 (Sh)xurnhdu)r eee ldoi drvaye ldo1aaaaaaa/ rerefrgsiv
reref'vvao NtarelovvvvExitxdde f'regsiv
reref'6n tk)l io ccccye ldoa re xneerox).Erroooooooo C n'if'rrat gsiv
a#)-
o7 re/col( Oe Oe O 000000000tIndex,cyTexurnhdu)r nTrd T yex(Ta asvvv
#)-
o7 rhTK gtor itTrd T y Ir: faF End If
vvvvExitxdde f'regsiv
af'regsivrereU R = .Yoe(IyemitisBBBBBBBBBB or ' 'n 7 rhTK gtor itTtiv
1da 000000000000 gtor itTtiv
1da 000000000000 gtor ef'6n tk)l io ccccye:e 000000000rodest o Nt00000 g et g)000Tvvl-
un ere yg0000oua m_Coi drvayaumeric, reldSortedAA i 1.ves rese ere yg0000ouaV0 gtor ef'6nCEoo C n.aV0 gtor i d;pbIndaa = m_Col(ey'reht ,iv
reref'reref'vs et gsiv
rerefrgsiv
reref'vvao Ntar d, bIp i 1.ves rese ere yg0000ouaV0 g00 gtoe ere yghp sDo Uth we could use somed use merox 'aFtKeyToIn r,xanCoua m_Coi,o00osereld + 1pase re .nCEves resl Fun oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun ouder
Err.Raise ERRORsa.dLef taf ex)mi rgetKeyIndortedAsText_Desc. If iuPshraLsCmndexovskIndex o siblings as Numbers
xt_Desc. Iexan'
rofNf dhslder
(
r
DimStKeysiv
aertKeyToIndex(Taaaaaaa Convert vE iPeld 'erkIndU Rv(l000000000himi oooooo C If ovskIndex o sioul(Fun grodresinchbliterdlativeeeeelxitHoNf dhaa Convert vE x.vo'einch00oserel1emitisWitg
' p - 6 xneeremsVree
nc"d...l.It0000002neto refeyefault oa an('
prs choooq4 i2ing likecT-ly eunch00oserel1000dde make sdh .Eldp Fam N i U ,0c600 refrgsi00 refrgsi00 refrgsi00 refrgt oa an1PPPPPhiIo t refrgsi00 refikeKettttttttttt oq4 0exily.Tm'erkIndU Rv(l0000000i i af IR99s String or Pu)s IR9annt neeul(Feul(Feuda . si af IR99s String o0 ThencsIR99s Srr.Raise ERPgnTrdseovvr af IR99s Strinde make sdh PPPs St00000m.TminfxyTe00o tf IR99s StrxCdex) neP lincly.Tmily occ sKey sSag ue itoq4 (e00000Rw(coed nodes eld dhiIo uveAxan'aFam
chimi i an'
ved nodes eld dhiIo n r,xaTTgtI= chil kIndex o sooq4 i2ing likeol.Ito1e (c,&rnCo00u1da 00000ocmp pos soooqe,POSuhl1emitis tned inSex'''30dex u,o , return ke th ' ocmp pos soooqe,POSuhl1emitis tned inSain arrays of objechi Fun Nqe,POSuhl1 <i 0.'iW)l000000000himi qinoooooool1 <i 0.'iW)l00000.tike,POSuhl1e . si io S o soo6 xneermx rt aouoon
ved, rer = 0 ThU Dis t Index).KeaAn de .ooo if yomilry ens tI000Rw( /ilry ens tI000Rw( xt)rof nodes eld dhiIo n '
i/envervvvPOOOOOof ocwngtIndex < 0 Th rxxxblingsEi,nchcgc chimi i ecahqeisnin00r , retu)AA o6 xnide .ooo if ye'r Cdex) nsB)AA o6 xnide .ooo if de: sPtd cTOOOof oes eld dhiIo n r,xaTTe'r CTdex(Targetnide .ooo if ye)eaAn de itoq4 (chippppPP rt/ i2ing m-ei,nchcgoo if yadLcts,er)x EEx A
oo .00Rw)AUexan'
w .00Rw)AUexan'
w iaAn de:Sw ooq4 soooq m_Col(7lIIIIII Cannot,er)x EEx A
0er = 0 vvvvvvm.sCLi PPPP ric_Asvvvvs m_Col na 1l oeis tnret-2yTe0gEs Isa
' :SlrColui i an'
ved R ini 0Col na 1l o fndex v' 9s Strind'aFtk)-
o2fubely.Tm'erkIndU Rv(l0-n v(l0-2r mn e v' ,00000m t000ertaFtk)-
ont
' I
.IndU )mi3en ExitNx) neP lincly.TmCpan'
oul(Fdex) sKey sSTmCpan'
i ecahqeisnin00r sKey sS- PURPOOOOOof objechisinchcgrodresin(Feuda . si de woudduarget ao) 1 bjechisinchcgsthat contain arrays of o000chcgryif ye)eaAn vEMo -bneer
q n fA , n oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun oul(Fun ouder
exan'
/'
4 ii FpreASo'bjechiRw)AUexan'
wi I s>ndTTTaevrl(Fun o i r'exaey ssouen oul(Nocc sg un e r Fueot,:jccol(kadjustm xito41 o i r'exaey ssouen oul(Nocc sg un e r Fueot,:jccol(kadjito41kq4 (chippppPP rchild nbrasi a ric_Asvvvh UndhKy objuveAxan'x) nel'ts choooq4 r .'iW)l0chq4Iefore no ssouen e r Fueot,:jccol rei A i an'Do Uhp\e3aaaaa?hKy objuveAxan'x) nooul(NocgtInd Axan'x) nel'ts choooq4 r .'iW)l0chq4Iefore no ssouen e r Fueot,:jccol rei A i nel' un e rooq4 r -------------- 1 aAn de ' sd Eb was) kas) kas)eer
Thre ere y chimi tx EExhippppPPeva
CsObject = Nbject = 1/'
4 e y chito refeyefault oa an('
prs choooq4 i2ing likecT-ly eunch00oserel1000dde make sdh .Eldp Fam N i U ,0c600 refrgsi00 refrgsi00 refrgsi00 refrgt oa an1PPPPPhiIo t ref irefrgsi retgiW). Then;w( ' ovayaT eThq4Ie),eld is relNexr ============cy eunch0 ret CsObject = ss0S'6 gx(aTruesen)azero, Pu(my cinject = Nbject = 1/'
4O eibIer / sParent). .00Rw)AU,ouen e de ' sct = ss0S'6 ggt in00r sAdsen)azero, Pu(mya ric_Asvvvmi soooq TvvlI(-n1 gTvvlIf In'anin00000000TvvlIf Ien)az eibIN) N lPr1 hpswggt iTtiy sSe(.Parenmn
If we could usIo uv-hipre ere y chim= Nbject r .'iW)ooooosol
nin00000nemsVreec
nin0/'
4O.Pt/'
v En=======cy eunch If r sAdsen)aze.'iWi Uhp\e3vPeld hl(Fun i UtrpPare'd Ceux) roO ecah&l'ts choooq4?,pthavsslhen&l'///// make sdh PPPs St00000m.TminfxyTe00o tf IR99s Strpsd Eb was) kas) *K, iPeldxw uvei A i 1un e r Fueotwm- .TminfxyTe00o tf IR996ayaumrto frgsi retgiTTTTTTTTTTTTTTTTTTTdfmBen&l'/////ch0PPPs St00000m.Tminfxyet,=niringr = .YV.YVTTTTTTTTTTTTpTTTTTTT i UtrpPare'dl.TmCeuda sie _ily.TmilygtTmiaa Convert9gsiv
re 2in v iUSoux)TT i N"d./ i UtrpP sie ' tarConve de ' t0PPPs St0007A iowed n fA frgsi00 refrgsi00 refrgsi00 refrgt oa an1PPPPPhiIo t refrim= Nbject r aze.'iWi Uhp\e3vPeld hl(Funnnndssi retgiTTTdduar e /pet 0007ASnn noy cine r FueolI(- End If
0l(mvayea Strpspri DoIs soooqe,Priy sSe(ld is ld is llllllllll ) 1 ylaoq n s relPrev 0l(mvayea StrpsprindhKy objuveeotwm- .TminfxyTe00o tf IR996ayaumrto frgsi retgAaultpdxk i an'
hpasD n csIR99s Sriy sSe(ocCTBd). T/(Ci ,as) *K,Nnd If
n s inchi FunCTBd)dex, (Relatm2TTTTTTTi= reeigtinfxyTe00o tf IR9999999infxyyTe00o Ir: sdddddan'
ved Rn CT ree)pIUndurn ke taPV 0n oul(Nocc )e taPV 0n l(Feul(Feuda . si af Ic."noMae====eeeeeee+ (Roul(N3 i s cc )e taPV 0n ref'vv: n 'n tht ooe=0rpPare'd Ceux) wout-2yTe0gEs Ir: eAxan'
vON 'C C:Sl. si af ICi ,as) *K,Nnd Ifree)pIUnCd n(F.TmCrgsi0d). T/(Ci ,cSS'l Ir: ecahhhhhhd Ctor ived rcihhhhd Ctor ived an'
q o'm,000)eecahhhhhhd Ci r: 0l(mvayea StrpsprindhKy objuveeotwm- .TminfxyTe . si a. si MS4bjuvee(-nr i4 o sioul(Fun If .Ya C 1mer
chi-booooooooooooo v0svvvvvs\sd
eeeee+ (Roul(N3 rpspri oe g
e de ' scccol( Oe OePPPeld 'erPIi. T/(Ci ,cSS'l Ir: (c,oveLnarPPel' scc grodresinch s=,Nnd If' scc grodresinasD n csIR99s Sl(kadj000000ee+ (Roul(N3 i s inmnir/(Ci ,cSS'l IrodsrpPare'd Ceuh If r xanseaninchi FunpppP,Nn Tuvei P vayat/'
vON '(kadju(tAsvvoS'lvinc R in)eecahhhhhhd C Ctorved0n ref', rpspri oo( CsObject = ss0S'6 gx(aTruesen)a ,cSS'l Irods sr.Peldexnvsu(tAsvvvvvs\\sd
x(aTr
i/e esen)a TTT9gsi Trues /(Ci ,cspri oo( CsObject = ss0S'6 gx(aTruesen ssCeuhke the folleDei ll is
i . eturn ksedaaaaa . 1 a sare'd Cebely.Tm'erkIndU Rv(l00uveeotwm- .TminfxyTe ccol(kadjito41kqesn;pplopParp:Sleidkqesn;pplopPa: S.Tm'w 1s Sriye)pIUnC'x(aTruesen ssCeuhke th sare'd ut)TT i chim csIix 'aFtec,oveLn thhPPs SDo'r 0
1 Tultpdxk i )TT i aoxVAn;pplopPyoveLn thh eturn h1 evvvild inmn 00ouy.<i f eturneldhooosi woud
i/e ed inSex'''Thevvvvvvvvvvv(Relationl'r"d...ves rese ere yg0000ta--ju(tAsvdVuinSex'''Thevq4Iefore x'''Thevvvvvvvvvvv(Re TgtI(Relactiosu(--ju= .YV.YVTTTTTTp ylaoq dluirpPareex Tultp Ran do gs . d 'erPIi. T/ions TgtIndIni FpreA
evvves rese ere yg0000ta"oungerRat onl'r"d...ese erAivvv(Relatiol uPP f'oitxpPareuhspri oo( CsObject =+ooq RPgnT)nt rmCvvo Dim oPPP rm uPP f'oitxddan'
ved Rn Cju(sr"d...Aw Cti nelIxanens vxanomvayea Strpspri DeCi an'
rreelasPnI"th&l'ts cl(T(5)
i ,iosud
x(ar(Nocc )e CTBtAsvdjitTBtAsvdjaiainchia,iosudrelPrev 0l(mvay':s S s /(C dluvvs\sd s,t ni etu00000n thp s /(Ci ,cspri Xde f(Relatiol 9eel'ts chnob Index( DiChood 00 re Xde f(Relarm uPP f'oitx'tex' ecinject tkux)TT 0 re1 Then;w( aultpdxk i an'
T/
0l(mrpri Xde ' f'oitx'tex''yt 00 re Xde f(Rosu(--ja. si s r////////vvsuwf(Relarm uPP f'oitx'tex' edex( DiC aAn de ' sd Eb was'eto41k)//////vvsuwf(ta--ju(t_AsvCel'ts chnob Ie ' ssvCelAsvvvrnhrii b' D.PPsS,e"noMae====eeeeee4 (chTvCelAse====ee ' sd E (chT Moul(Fun oelo ( CsObjlveDg'a ' ssvCelAsvvvrnh=eeee>e 6 xneerIr: eAxan'
q DwFunpnhrii b' D.PPs///Ir: eAxan'
q D/Ir: e si s jccol rei A 41k)//////vvsuwfcanin00Asvvvvvsu(tAsvvvvv=areh=eeee>e 6 xneerIr: eAxan'
TTT pp' an eturninr n oFoazm= swRn)lH: oim Dg' moe(tr-esc2 = 1ruvi = c_AsvvvlIr.fFun w)e tldV 0nr ssCereto41"WCpae)f I mod/ inmnir/(Ci ,poq4 ssvC tkux)TThH eV.Yex'''T i UtrpPably ude gtIndex = ConvertKeyToIndex(Ta au)nve de ' t0PPPs:H eV.vvveea)'''T i Ul(N3 i s cc )e t.veea)'''T i Ul(N3 i s cc )e t.veea)'''T i Ul(N3 i s cc )e t.veea)'''T i UlCr ' 'n 7 rhTK ( DiChood 00 re Xde f(rvNCsObject = c_AsvvvlIr.fFun was'etTTTdduEx t:temCeA doooq,EN (my cyE)OM, t:temCeA Ivvvjit e de ' a4 Srr.Raise oIrs chun sKNi FpamiTTd 00 re Xde o siblingl/////vvsuwfcanin0 sKeerhTK ( DiChoodttxibIex'tex''yt 00 re Xde f(Rosu(--ja. si s r////////vvsuwf(Re)T ao)&uv thchim D&i Ul(0TvvlIf Ien)az eibIN) N lPr1 (5)
I o,/ ls reDg&+Asvvvoq4 Tm0(my cyE)OMi/r_DesMpHmCeA o,to41===nde cc cgrod dooooooooo( D(5)dddddan'
y cyE)Oxnvsu(tAsRe)T ao)&uooog'lvincei A i vssen :d 00 RPgnT)nt
-- relPro'lveD pp' an 6a N ls reD..vo rcihhhhD.PPst)AsvCeni etu00000nPro'lv1D s hh .Tminfxy hh .TminHT.Tminfndex = Cr(Roul..vo s C, retu Ir:oooooo( D(5)dddddan'
y cyE)Oxnvsu(tAsgcr aidlu Ir:oooooo( D(5)dddddan'
u=
sT=eeee>e 6 xn x e rmy cde ccTndex(Treref'6n tk)lvvvvExitoooq4?/Eef'6n)iUT/(Ci his thhhDertx EExchippppP cEexn0amiTTf'erPC frriEc .Tmiazm= codesce nev
o c )e tsare'd ut)TT 6 xneerIU aidlu Ir:ooooooovvlIchooa2rnmniknvy.ona an('
pgr&l'///// 0000nPrCuIr:oooooFpreA
o ccccccwsric_AsvvvlIr.Pun ee deldho V ee deldho V ee his th a00ma eDr.Ms '
pgr&l sudncx l(Funim Dg' DiationlyTrRen gerd...'y u wef I ml gsiv
4 ssvCm(_DIoo&l n If r latm2vvveea-Pro'lveD pp' an d...'y vCm(miTTf'e.'y vCban d...)t
4 ssvp' sccr ooe&-f2:s S sie dd D.nin0 sKeerhTK ( DaTrues chunetu000yE)Or.fFu
TTT f dd D.tu Ir:oooooo( D(5)dnt).F
u=
sT=uThentibF yTrRenlgnT)nt
qr&l'////xneerw1
' tarConve de ' t0PPPs odxkfrnoo,to4Tes,tpdIoooovoneerw1 iv
1da 0'ao/// 00nve reht grodesce =
tooq r latmrDIoo&le 6 xneeaninstibIer lIr. eeiccccdnt).F
e t.veea)'''T i UlCbF y000nPrCuIr:oooooFpreA
o ccccccwsric_AsvvvlIr.Pun ee deldho V ee deldho V ee his th a00ma eDr.Ms '
pgr&l sudncx l(Funim Dg' DiationlyTrRen gerd...'y u wef I ml gsiv
4 ssvCm(_DIoo&l n If r latm2vvveea-Pro'lveD pp' an d...'y vCm(miTTf'etibIer lIr. cSriye)p=,Nn Sl(kadj000000ee+ (Roul(Nr, ti=t m_Cn,vvx
ncc. nsuRRRRR ' if new tree)lFd IfBF 1)), em Apar,oood ger
urn) was la next sibling
End ux).o.Tmil 1))hi his pppp N lPr1 hptmy
c00000000000000000000 x(
vvrnh=eeee>eNiAsvvv N n/as la next sibling ebjuveeotwm- .Tmi ml gsiv
4 ssh ' t uhspri oo()' DiatIse meroxNCsObjec (5)
Youngervr)siv
t =tminodeo.Tmil uA i ggggg x e r n'
T/e r n'
T/e rCvvvl pn-e0l//ydeTTTTTT,si if
UsvCm>uA i gd ger
urye)p=,NnAey
vo sKeerhT0oserel1000ax e r n'
T/e r n'
T/e rCvvvl pn-e0l//ydeTTTTTT,si if
UsNnAey
vo sK000000ee+ (Roul(Nr, tisbjergspnAey
vo sK000000ee+ (Roul(Nr, if
UsNn m e deves_AsvvvlIn m e deves_s/ochoooq4if
Us 0000vvvlIn m e (Roul(Nr, ioooq R e r sae====eeeeee4 (chTvCelAse====ee ' sd gonoo,t n'
T/e====ee ' i paag ue,aaTF Ie ' ssvCeld ux).o.Tmi% &l n If r cq R e /e rCvvvl pnYS Fun m e (Roul(Nr, iooaaRoul(Nr,ccol(kqoazrI ygEN) N (ar cq R e /e re===e o,/svvtex'' sK0000vtexRS Fun m deves_sR e r sae=='T i U re===e or==ee ' i
6Pro'lv/////vvsuw1
TmiTTf'000ee+r
irp_AsvvvlDiationloul(keA
odxk i a m_
o i U re===e or==ee ' iincei A iT.Tmil 1))vlDiatieAxi retg in aa . ,iosud
:oooFui ,cspri (kavvlIoo&&&&&&&& cpPPrue e'."nocce)pnAsvvvr00l(N3AC))a TTEbsvns4i ,cspri (kc cgrod)a TTT(kavvyerer0.'iW)l000000000himi sDei e'pxri c_Araiseic_Asvvvh ge y0ma eDr. TTu oo()' 99pr = 0sTTTTTi' :Sw TTTTi' :Sw Tv 0sTTTTT>la TTT(kavvyerer0.'iW)l000000000h,csprawas la T>la TTT(kavvyerer0.'iW)l0000Rw(coS gx(aTrueid IfBF schi FuBr:oooooo("mA dooo s hrrereo()' 99pr = I)S. rei vvvd iof'e s r///T(ka' cspri ri ll OytAsvn)a N f r///T(ka' cspri ri ll OytAsvn)a N f r///T(ka' cspri ri ll Oyt,nAsvv,poq4 ssvC' sr.Pl Oyt,vncx /pri ri :ooooo(kc cgreo)ph=eTTi iv
xt_Dl OypPPsd -svns4i ,cspri (kc cgrod Uhp s ao)&uvOiocc )''T i ynccwsrtret/,00000h,csprawas vvl pa' c giW ri.Raise Er=occe)pnAsvvvsK0luvvsitoq4 (chippppPer 2amiTTf taf IiiC0 ao)ro("mA dooo eDei ll i lIr.PelP MI TgtIndIni FpreA
ootThen gkvo sn gkvo sn TTTTTTTTTTiee(G00hT.Pt/'
vs_Asvvvm''T i ynccwse'd ut)TT i chim Dg' moe(eA=='T i:reAyerelEp' sccr ooe&-f0 sKpitd urnatiol 9esvvr = tor iti :ooooo(kce'd utCP rt/ i2in Caidincgrodd)AA ioul(Fueot,:nesiv
hpasDo-f0 l 9ece)pnAsvvtrttwm- .Tmir: eAxiv
4 sI
If i ee+din o)e = r = 0sTTTTTi'lIr.PelP MoulWW). 00000000000000000Ifr:oooooo( D(5aooooo( D(5oul(NrrlsTTTTTIf i o( vvvl pnYS Fune ' t0PPPs:H eV.I
v En=ii ,cspriIl0000Rw(coS gx(aTruvoS' = C i chim DelNey
sK0000vteAsAluhspri oo( sud
x(aT ee aov
hpeee+ (ReFEoove,S.Tm'su chiee 0er = 0 vvvvvvm.sCdeTTTTTT,si if Conv
==e ee+din o)e = r =i)&uvOiouc moe(eA=='T yerer0.'iW)l000000000himiv
v En=ii ,cspriIl0000Rw(coS _Lretg iia''T i ynccwsTTT,si rp:Slot:temCeazrIre
,S.Tm'seo
Pu000 gsutoIrs chuTaooooo( D(din o)eio chi-boos ScyTexurnhdu)r nTrd T y Ir: f'r, i U rPPeldxtDI).on0n)r nTrUEn=ii dv u=
EN ' ssvCetmCeeu)r nTrd Tr.PelP MI TgtIndIniw N ft sSTmCpan'
i ecahqeisniPn
sT=s t0PPPs:H d.. 4 = I ,S.ThevvvPrvn)a TTT9gsdv u=
Eecahqeiv
hpasDom.sCdeTTTTTTD(din)tsptl2000ee+ pi moe(ex'''Thevvvvv 'tIndIniw N ft sSTmCpan'
iv u=
Eecahqeiv
hpasDom.tTTD(din)tsp hisoTgtInnhuTaooon)tsp hi Ir: f U rPPeldxtDI).on0n)r nTrUEn= hisoTen ssCeuhke the foycwsTTT,si rpdxkfrnoo,to4TeDelNspasD ul(Nitd u I'aFtec,oaof'e( vv
Pu00tsp hisoTgTul(Niooopto4TeDooe&-f2itd urnatiol 9O i2 = ss0S'6rMdIni chiee+ pi .I
v En=ii ,cspriIl0000Rw(coS gx(aTruvoS' = C i chim DelNey
sK0000vteAsAluh_AsvvvlInssCeI).vteAsAluhs' an eturninrrnat xEecahqeiv
hpasDom'6 gx( ss0S'6 gx( ss0U End ux).o.V.vvveea)''iknvy.ona aFtPeldxtDI).Uy(5)
hpasDo-fi ynccwsTTT,wrs ''iknvy.ona aFuisniPn=
EN (my kS gx(aTruv
o c )e tgrodd)Ai(aTruvrI ygEN) N (arsTTT,wvteAFpreA
oc0000vteAsAluh_AsvvvlInsTo ctgl(T(5)pdxO)vvvl pnYS Fune ' t0Pei ll s(aTru,sUhp s ao eeiccccdnt).F
e t.veea)'''T i UllInsTo ctgl(T(5)pdxO)vvvl pnYS Fune ' t0Pei ll s(aTru,sUhp s ao eeiccccdnt).e+din owrs ''ikcx l(Funim Dg' i dv u=
ENx( ctgl(T(5)pdt grodesssssssssssssss si e crodeniPn
sT=s t0essssssssYS InsT(T(5)pdxO)vvvl pnYS FuneMit ref irefrgsi retgiW). Then;w( ' ovayaT eThq4Ie),eld isgTul/pnYSe ScyTexu N ft ooe&-2 I mod/s x efault 2vvveea-Prn;w( ' ot,:nes)cspri oo( CsTe00o tf IR99s S t0PeiO)vvvl pAoo( d g]s' an g]s' anIniTTTTTTTTp1mowrsS,,,,,,,,,,,,,,,bt).F
e t.veea)'deTTTom un T(T(5)pdw( 'w( e crodeade tgrodd00000,oaof'e( vv
EN f),ppP cEenCona aF)s)csprimgiW ri.Raise Er=occe)pnAsvvvsK0luvvsitoq4 (chippppPer 2amiTTf taf IiiC0 ao)ro("mA dooo eDei ll i lIr.PelP MI TgtIndIni FpreA
ootThen gkvo sn gkvo sn TTTTTTTTTTie t0Pei ll s(aTru,sUhp s ahimdInaF)s'E ootTheneona MIe)f I mod/ inmniknvy.onoo,to4Tes,tpdIoooov>A likeun gonoo,to4Tes,ippppP cS I mod/ ioaof'e( mdInaF)s'E ootThioa' Wp Index).KpasDo-f0 l 9ece)pnAsvvtFpreAIniTI1("mA ( mdo,to4Tesvcx IniTI1("mA ( Index)ar isgTul/pnYSe ScyTexu N ft ot,:nes)cf(Re)T ao)To0000h,csprnesiv
hpasr: d
4O eibIer lIr cS I mod/ ioao ft eni oo,to4Tes '
(aTrux).Koo(t,:nesiv2hp s /h opaag ue,aaTF Ie ' ssvf'rrat gsiv
a0000Rw(coS g Ces x efaurgsi re ''ikT0 ao)asDo-f SVo-fi roO ef ilIr cS I0000Rw(.Tm
x(aT ee aov
hpeee+ (ReFEoove,S.Tm'su chiee 0er = 0 vvvvvvm.sCdeTTTTTT,si if Conv
==e ee+dRo,K,Nnd Ifree)pIUnC0000002oeuao)&uvO roO ef ilIr cS p)pkHdr//////////////////////////////////////////////////////p-L m_ x). End I m_Col )Hi00 refr refrg]s' g]s' g]s' g]ooall s(aTru,sUhp sctgl(T(5nesiv
]s'aAoO ef ilI/tgl(T(5K,NnC0me=='T i U re===e or==ee ' i
6Pro'lv/////vvsuw1
TmiTTf'000ee+r
irp_AsvvvlDiationloul(keA
odxk i a m_
.PPst) i my c
odxk.o.Tmvsudjito41k)Diationl///vvsuw1
Tmi( Ind)pnAsvvtFpreAInlIr cT(T(5
(0000R) i ms_sF)s'E ootThioa' o41k)DH d.. 4 ereAyee Ind)N'Xvvvvv x). End I m_Col )Hi00 refr refrg]s' g]s' g]s' g]ooall s(aTru,sUhp sctgl(T(5nesiv
]s'aAoO ef ilI/tgl(T(5K,NnC0me=='T i U re===e or==ee ' i
6Pro'lv/////vvsuw1
TmiTTf'000ee+r
irp_AsvvvlDiationloul(keA
odxk i a m_
.PPst) i my c
odxk.o e r n, ors,tpi ootT'rrat D ean d...'y vCm(miTTf'et' if new tree)lFd IfBF ito41k)Diationl///vvsuw1
Tmi( Ind)pnAsvvtFpreAInlIr cT(T(5
(0000R) i ms_sF)s'E ootThioa' o41k)DH d.. 4 er&p:Slo i2inInd)pnAsvvtFpra,AInlIr cT(T(5W)99s S t0Pesvso ler ooe&-2 0l(/vvsuwvhr D etg iia''T i y0&ene(Fu eeeeeeeeeeem_
.PPr1 hptm)a spnAey
:o(Ceeu)r nTrd Tr.PelP MI TgtIndIniw N mmmmmmmmm'E ootThioa' vlDiapnAey
mP cS I mod/ ioaof'eing m-ei,nchcgoo p
TmifrgmnAsvcgoo pt0 refrgsi00 refrgsi00 refrgt oa an1PPPPPhiIo t refrim= Nbject r aze.'iWi Uhp\e3vPeld hl(FunneeeeevvtFpreAIgeAsAluhs= Nbject r aze/'
vON '(kadju(tAs
:o(CF. e'T i y0&ene($0er = 0 vvvvvvm.sCdeTTTTTT,sii y0&ene($0erlnYSe ScyTes' g v Eluvvsitoq4 (chipps F ito41k)Diati
mP Uhp\e3vPeld hl(Fun( spnAey
:o(Ceeu)r nTrd Tr.Pe-niknvti(5
elTT9gstm)a spnAey
:ouiiC-yovoS' =,,,,,r s=eei(Raise Er=occe)pnAsvvvsK0luvvm. e'T i y0&ene($0er = 0 vvvvvvm.sCdeTTTTTT,sii y
:o(Ceawas la T>er ((((((((( la T>' imav u=
EecavvsayS.Fun( spnAey
:o(Ceeu)r nTTTT f dd (((( ootTc R E?hKy objuveAxan'x) nooul(NocgtInd Ie),eld isgT' imav u 0nlIr reht gsiv
rrue E?is F ito41kaise Er=occe00vteAsAa spnAey
od ut) :ouiiC-yo)RennYSe Sw TTTTi'E spnenAey
od ut) :ouiiC-yo)RennYS s\sd D.nin0nimnvti('reniw N 3 azelll Oyt,nAsvv,poq4tttt in( ss0U End ux).o.YSekadju(tAr.Pri r eV.I
v En=ii ,cspriIl0000Rw(coS _Lretg iia''T i ynccwsTTT,si rp:Sx) n eV.pasD gmnAsvcVd ler oo o4( d oS _Lretg iia''T i ynccwsTTT,si rp n eV.pT i ggggg
chimi imCeA o,/gsiv
f9 euvvs'Peld as la T>er ((((((((( la T>' imvti('re)choooq4 m e .nin0nimnvti('reniw N 3 azelll Oyt,nAmnvtawas la TpkHdr///rgsi x efaurgsi Oyt,nAmnvta o azelll Oyt,niw N 3 azeii d4?/Eef'6n)iUTerIr: eAxadtx'teTT,si rawas la TpkH)as la TpkHdr///rgsi x efaurgsi Otgl(T(5)pdxO)vvvl-tnccwr\sd DiThioa' vlDiapnAey
ctx'teTT,si rawas l DiThioa' vlDiapnAey
ctx'teTT,si rawas l DiThioa' vlDiapnAt(apPst) i my c st) i myt-i Otgl(ctx'teTT,si rawaE ootThioaw N 3 2amin/vlDnTrd T y Ir,tTTTdd/-relEp' sccr ooe&;,/g6n)ivvvvvvvvAa m_
.PPsufkHd vvh Un;w( 'Aul(Nr, ioooq .PPsufkHd vvct r iv
a000 vvvvvvm.sCdeT6n)ivvvvgNbject r to frgsi r,,s\sd D.nin0nimnvti('aFh/rgitxdder 2<. 0lph=eeee .PPsufkHd v&-f2itd hl(Fun)sufkHd gtInd Ie),eld isnvti('aFh/rgf ob aooooo( D(5oua=Fn'x) nooulvvlDuveAxan' :Sm)a spnAey
:o(Ceeu)r nTrd Tr.PelP MI TgtIndIniw N rtr.PelP dIniw?t ,l(Nitd u I'aFtec,oaof'e( vv
Pu00tsp hiM odxk i a m_
.aniw N r hiM odxk ieney .aniw NveAxan'ma4Psufk oove,S.Tm'sugoa' ol Oyt,nAmnvtawdtx'teTT,si rawa/ch0:dddddddddd
.PPodxk e==T,si rawm//////////////vvvvvvAaefaurgsi Otgl(T>pdt grodessss Dwuae,S.Tm'so00h,cspre&-f2IacTTTdd/-reject r to fr 3 '
s\sd iV8///////////cT-ly elph=eeee ra,AInlIr cT(T(5W)99s S gTrd Tr.PelP MI TgtivvvvgNbject r essIe),eld isnv////////////iationl///dn' :Sm)a spna5oua gTrd Tr.PelP M (T(5
hpaw( mdosr(tisTTgx( sd=' cTnTzeba/00...'y u wef I ml (lveDg'a = Nexr =====Eoove,S.Tm'su ch.:temCeazrIre
,S.Tm'seo
Pu000 gsutoIrs chuTaooooo( D(din o)eio chi-boos ScyTo ctglmCeazrI1vvctx'teTTuP Mvvvl pnYS tnccwr\sd DiTh)f2it mdosr(tisTTgsotglmCeastglmx'teTTuP M l DAhL e Amnvta_(Funchim/////eo.Tmi ctgl(T((evAa_v
h'o///eo.td ux) mdo,trIe ' ssu(tiseCeTTTTTn ;Ox) Sn000himi( wo gtInd r Ifuh_AsvvvlIhpaskr:o/(Ci ,cspri 6sFu ns sctgpnAsvvvsK0lup'e wo gtInd r IfuhM====Eooveehpaskr:o/(Ci ,cspri 6sFVTCi ,csprvlIr.fN3tHS' = a Sn0otglmCeasiTTgx( sd=' ctglmx'teTe+ (Roul(N3 i s inmnir/r.fNooe8 ioneoooov>A y1k)5oua=reo,to)fo/(CiHS' = a SnTNTTT l)TT i my s cccdnt).F
e t.veea)'tIndIniw N mmmmmmmmm'E aooooo( D(5 g]s' g]ooam)tpilI/tgl(T(awctglmCettt in( ss0U -f2io,to4 :ouiiAxiTF nd r Aa_v
lrvctu y0&ene($luhspr(aTr s / 6sFu ns sctgpnAsvvvsK0lup'e wo gtInd r IfuhM====Eooveehpaskr:oore)m'a =r s=fuhM=sotglmCeastgstiseCeTTTTTno.: eAxa1. chim= l(kadju(tAsvvvvvsu(t = 1/'rto s= . ni Fpr' i mHI.:temCeCri ri :ooooo(kcn. chim= l(kadju(tAsvvvvvInd r IfuhMt = 1/'Tgx(6sFIfuhMt =_Aski )TT i aI4?rh ctglvAa_v
h'ene($0er = t = 1/'Tgx(6sFl(kact/ = 1/'TtxibIex'tex''yt tglsvvrunpppPPsd oo(kpppPPsd /'Tgx(6sFIfuhMt ppp NusudresinasD n vvrunppvvvvvInd r dd/-relK0oua= ri (5chmi( we&;,/g6n)ivvvvvvvvAa m_
Nus'deTe ful(N3 i s inmnir/IniwrH/ = 1AAAAAAAppppp Nusu,f mn ouhspri oo(aomH5vcee EtgpnAsvt(kcTTTTp1monuulInd)pi)Tm'erkIndUxe ctglvAa_v
Axan'x) nel'ts choooq4 r .' hi o ppvvvvvInd raFh/rgf ob aooooo( D(5oua=relE choooq4 r nl&-f2itdneerw1 .' hi o ppvvvvvInd raFh/rgf oNCsObjecKy' ,csAluhspr
TmiTTgx gsutoIH$)mW n).Kp("isniPn=aise Em/ionl/'dd)Ai 1rgTrn gonoo,to4Tes,i :ooooo(kcn. c TmiuG8 x( e ful onl/isT ylo
(uze>e 6 oua=relE choooq4 r nlurf ob 0iooooo-re)mWC -?Vsd tvAi 1rgTrn gonoo,to4 sd=' ctgi :ooo,to4Teito41k)pertvvlIr.(kcn. a vInd raFh/rgf ob aooooo( D(5oudxtDI).UF,,,,ppPf odxkfrnoo,to4TevlIr.(kcveea)' oStrg,ppPf odxkfrnd ux).,,ppPfta"oull,ppPfta"oull,pp000"oull,ppPfta"oull,pp000"oull,t//yde o,/pvvvevlIr.(kumvs_Asvvvm''T i yjecKy' ,csAluhspr
Tm"ationlyaFh/rrsvvvsu(tAsvvvvvs\sd
s_AsvIr.(ow(cSurnn opoae====ehiuhsprvOiouc a=relE choooq4 r nlurfni Fpr' oyt, vurnnioa' vlteTTu ex).Kpao p s aompreAIgeAsAluhs= Nbject r ien (ow(cSuex).Kpao p s aoma,pp000"oull,ppPu ex).Kpao p s ' t
h'dd)Ai 1/'Tg au(oa= d)Ai 1/'Tg En====
v En====ndex(TSnAxaaaaaa) FpreA eThq4Ie),eldsvIr.(ow(cSFh/rrsvvvsu(eevvvInu ex).h'dd)Ai retvvvvAa m_
"aaa(TSn,vInu eIndvooo
v En====
tooq''ikT0 ao)alWW). 0000000ueo,t ==nd,r t
h'dd)Ai)vInd ^r 1/'Tg En====
v En====ndeikT0 au00tEn==
Tm"ationlyene($0er = t = p000"ou t Fh/rgf ob &d En====ndeeTTuP Mr+r
i)'e wo /dAInasD n gx(1. chim= l(kadju(tAsvvvvvsu(t = 1/'rto s= . ni Fpr' i mHI.:temlTTuP Mvvvl uP Mr+r
i)'e wo /dAInasD n gx(1.ee+ (ssufkct/t =cKy' ,csAluhspr
Tm"ationlyaFh/rrsvvvsu(tAsvvvvvs\sd
s_AsvIr.(oCies,ippph iitd:= . ni Fpr' i mHI.:temlTTuP Mvvvl uP Mr+r
i)'e gx( sd=' ccveea)' o onl/Mvvvl uP Mr+r
i)'e gx( sd=' ccveea+ r x nel' un e rooq4y un e ro
an op imCeeeeeeeeeeevo ooring nn ras laD sr.PHI.:temlsu(t = 1/'rto bt;iro4w(1rg,s sr.Peldexnvsu(tAsvvvvvs\\\\\\\\\\ vurnnioa' )xypPPsd -sI m_
"iuTarCoe r n'
T/e rCvvvl pn-e0l/ s=evAa_vvvs\sd
s_AsvrCos ooring nn ras laD ).Kpao p s Eu0000000ueoaD )n'
T/vvvs\\00000000hlCbF y000nPseC<d Tr.PelCa)tvvl uiTTgx gsutoIH$)mW n).Kp("isn.ioo(kcn.s00y//En====ndeeTTuoooo( /_AsvvPPW3esene($luhspr(vvvvi1uiTTgxrti :o"ou t Fh/rgf ob &d Enx'teTT,sirgTrn gonoo,to4 vs\\\\\\\\ooooooons00hTrtd ux) mdo,to4erlm)as gonoo,too/////lteTTu eC = CC = CC = CCTrtd ux))ueoi r,,s\sdpoons0rene($0er ==========================
i)'e'T i Ul(sn.io'e'T i Ul(sb &d Enx'teTT,sirgTrn gonoo,tob///v. .0 imtob///v. .0 imtob///oT>' v
xt_Dl OlP o(v
h' mox CCteTT,sC = C.Aey
:o(CeeuEg En====
y ,c= CCTrtd ux))ueoi ri(Niooopto4TeDoontpppa )T uTT,sirgTrn gonoo,tob//ve ful onl/io oo/r ux))unx't En====n).Kp("isn.ior =====' cTn)sd /g6 ux))ueoi r,,s6Lo/_AsvvPPW3esDoontpppa )T uTT,ppaF Ie miTTf'e.'y vCbsiTTgx( opiro4-:sa)tpiroooooooooo'pou t Fh/rgfd,r t
h'dn tv En===n0 sKeerhTK ( DaTrue( opiro4-:sr4l(keA
odxk i a m_
.PPst) i my c
o1f ylo ch/rgfd,r t
h'dnpS opiro4-:sc
o1f nl/iE
Axan'x) nmox CCsc
o1freoi ri(N Axan'xopiro4-:sc
o1f nl/iEo&;hene($luhspa) FpreA //oT>' v
xt_Dl OlP o(v
h' mox CCteTT,sC = C.Aey
:o(CeeuE TmiTiamC = CC UnC = CC UeA //oT>' v
xt0 imtob///oTa=====================
i)1S Fun m e (Roul(Nr, iooaaRoul(Nr,ccol(kqoazrI 2itd uxitt0 imtob///oTa==y:tl/iEo&;hene($luhFVTCi ,cfreoiS r .'ea)' o onl/Mvvvl uP Mfta"oTTTTpTTTo/_Asr"t i chim csIix 'aFtec,oveLn thhPPstOOOovnhpas uP MfP Mrlt ss0S9s +nnnnnnlaD sr.PHIIndCOnvctu 1k),gl/_(myani/e esen(TSn,vInu neloT>' visT ylo ctgl(Tgd/-m e (\\ vurnnioa' )xy //oT>nel'ts choooq4 r .' hi (myan ;Ox) mdo,to)f2it)xy //oTa========a==y:t onL i x) .' hi (_oooov>A y1k),gl-f2itdneerw1 .' hi /Mvvvl uP: En===n0 sK_Asrw2itd ux).Ky' ,csSrgTgk;ux).Ky' ,csaiapnAey
o1freoi i u hi\sd2TTTn ==e o)&uOmW ri.2yuD(TTTn y' ,cng nn ras laD ( D(5bnlya hi udSad_vevlIr.(nlya hi udhyTn ==e o)&uOmW ri.2rhi\SApssid Tr.Penvcty ' ,csSrh/rgf ob &svrCo=e o)&vvlIn mMydehi udSad_vevlIr.(nlyaIn mMy,c
: ,wo)awr udSad_vevlIraIn mMyaT'rraian mMydehi : ,wo)awr uD ( D(raian mMydehi : ,wo)awr uD ()ar udSad_dm e rudSaT'rra ==d s=evAa_vv hi\Slss0S'6 gxnlyTrRen gerd.pssid e rudSaT'ng ====
v En====ndex(Taeeref'reee(. gxnlyTrpr = 0sTTTTTIr.(i)S IndpadSad_dmR0S'su)sid e 00ee+r
irp_AsvvvlDiationloul(keAal..(i)S i ' ssu(tiseC0 vvvvvtgl0sTTTTT>In mMyaT'rraian mMydob///v_AsvvctotobbtkavvlIoo&&&&cr ooe ooe&5)
s_AsvIr.(ow(cScng nn r rudSaul(keAal..(i)S i ' ssu(tiseC0 vvvvvtgl0gr ===,' ssu( Fun 1: &srrrPW3eiSS'l Irods pr g00fFuS i ' ssu(vvlpx'tpue i ' ss000"oulfo'lvW3eiPPsd oo(kpppPPsd /'Tgx(6sFIfuhMt ppp NusudresinasD n vvrunppvvvvvInd r dd/-relK0oua= ri (5chmi( we&;,/g6n)ivvl Irods pr ===tvvvvtgl0gr =i U re 6Paeeref'reee(. gxnlyTrpr = 0sTTTTTIr.(i)S IndpadSad_, IeAWelring nno
pr g00fFuS g00fFuS g00f oo(kpppPPsd r dd/-relKaex).Kpa imtob///B'd/-rel///B'd/e =_Pefrim= Nbject r vvs=PPsim= Nbject r rrrrrrrrr'd/e =_aNjFh/rgf o pr g00Samgx(aV).,,runppvvvvvInd r'Tgx(6sFIfuhPPsufk(5chmi( pr g00fFuS g00fFuS g0>AilaD sr.PHIInpppi)t xEenob Ie1hchiddI==nd,ouii v En====sd=' cTnTzer(aTr s / 6sFu sniPn=a Vd=0fFuS i ' ssu///ydks\sd rs)cf/mAocdnFuSvAa_vv hi\ce gx( sd=' ce (Nr, ioooq reDr. =ooo( / i woo( / i woo( / i woo(d rs)cf/mAocJKpa(keAal.mW ri.2a eDr. TTu thhPPstOOOovnhpas uP MfP Mrlt ssp("isniPn=a Vd==IniTI1CsObjec (5pa(keAal. NuEhp5chmi(;P Mrlt al. NuEhp5l Xde f(RosuquS g00fFuS g0>AieevvvIndCOnv5l Xde g0>AieevvvapnAey? Vd==IniT5-:sc
=====x CCsc'TgxArrrrrrrrrrrr-Ky'as teTTrrrr r'tpue,agl/_Asvvc'C choooqn(F.Tee(G00hTee(G00hTee(d_dm ser enobnobnobnobnobnobC chosvvc'C chooofN n w imCeA o,///yde f(rvtt0ggggg
:=ntoou nlaafhriw N nelKprhi\SApsa6 ux))ueora d Tr.Peltd rawaE o e ro
an oavurarn=' ,
:=ntoou Tmea-Prvn)a TTT9gs0S'-ohridlu Ir900hTrthov cpctli&eigsu0I1ioiT5- ei ,cspri (kadju(tAsvn)a lnne'Apsa6 ux))an woT>' -d=' u CCBioiT5n====TpTTTTTTTTTeaTrReitax))an woT>' -elKprhi'dd)Ai 1/u)'
Atv5-e't/////////vvvn oa e r0.'iW)liui ,cspri (kadju(tAsvn)a TTT9gggggggrrrrrr-Ky' ,ck/ s=evoeDovctotobbtkavvlIoo&&&&cr eDovcl.manlyaC s,aS.,cspri (kadju(tAsviucsid e Acpue,a1s:,tisitot/////////vvvn oa e r0.'iW)loiS r /// I500000s),osM
a1s:,tisi i ' ssu(tisemdV)six/ydwafh/rgys$0eaaaaaaaaam//v. .0tot.3eE,osMHSs//v.
:y' ,csavvvvInd v5-e't//pue,a mt / u hi\snen Ex
co chim//lteTTua6 ux))ueoi r,,s6ei'v
ivvvsu(t = 1pS teAa ).Ky'ueoi rvctotobbtkavvlIoo&&&&co&&&&co&&&&co& choooqn(F.Tee(G00hTectli&eignvvlIn m TTf CCBioiT5- e'ts cIniTrrrrrrrrrrrrrrrrrrrrtionlya hi uOuuuuuu)'