Gringoire
Board Regular
- Joined
- Nov 18, 2016
- Messages
- 71
- Office Version
- 365
- Platform
- Windows
Hello guys,
it seems a stupid issue but I can't go out of this even after googling for a while. Here is my code:
After running the code some time to fill the m_timeList dictionary, this is what Immediate windows say:
For sure the Keys "prova2" or "prova1§" exist, because i can print it, but when i use .Exists, it always returns FALSE.
For sure I'm doing some conceptual error but I do not understand which one...
thanks for your help.
it seems a stupid issue but I can't go out of this even after googling for a while. Here is my code:
VBA Code:
Option Explicit
Private m_timeList As Scripting.Dictionary
'Timer class
Private Sub Class_Initialize()
Set m_timeList = New Scripting.Dictionary
End Sub
Function blockStart(nome As String)
'Start time
m_timeList.Add getTime, nome
End Function
Function blockStop(nome As String)
'Stop time
m_timeList.Add getTime, nome & "§"
End Function
After running the code some time to fill the m_timeList dictionary, this is what Immediate windows say:
Rich (BB code):
?m_timeList.Items(1)
prova1§
?m_timeList.Keys(1)
1194768,0593771
?m_timeList.Items(2)
prova2
?m_timeList.Keys(2)
1194768,059384
?m_timeList.Exists("prova2")
False
?m_timeList.Exists(m_timeList.Items(2))
False
?m_timeList.Exists("prova1§")
False
For sure the Keys "prova2" or "prova1§" exist, because i can print it, but when i use .Exists, it always returns FALSE.
For sure I'm doing some conceptual error but I do not understand which one...
thanks for your help.