I wanted to port a hashtable from agrahams collection library to the internal hashtable and found out that it doesn't work correct.
I think the problem is removing an item:
First MsgBox says "Train: black" which is correct.
Second MsgBox gives an out of index error.
Third MsgBox (after commenting out the second one) says "Train: yellow" which is wrong.
BTW: If I try to use the hashtable from agrahams collection library I cannot compile because it gives an error of duplicate object "hashtable".
Greetings,
Markus
I think the problem is removing an item:
B4X:
Sub App_Start
hashtable1.Add("apple", "green")
hashtable1.Add("ball", "blue")
hashtable1.Add("train", "black")
Msgbox("Train: " & hashtable1.Item("train"))
hashtable1.Remove("ball")
' This gives an out of index error!
'Msgbox("Train: " & hashtable1.Item("train"))
hashtable1.Add("ball", "yellow")
Msgbox("Train: " & hashtable1.Item("train"))
End Sub
First MsgBox says "Train: black" which is correct.
Second MsgBox gives an out of index error.
Third MsgBox (after commenting out the second one) says "Train: yellow" which is wrong.
BTW: If I try to use the hashtable from agrahams collection library I cannot compile because it gives an error of duplicate object "hashtable".
Greetings,
Markus