Home > Software engineering >  VBA code to run
VBA code to run

Time:09-16

Debugging stuck in this way can go step by step through without breaking point is jammed
The Function ForEachArray (arrayInfo As Object) As String
Dim arr As a Dictionary
Dim STR As String
Dim I, j, p As the Variant

For Each I In arrayInfo

If I (" Key ")="status" Then
The Set j=I (" Items ")
For Each p j In

If p (" Value ")="1" Then
STR=p (" Count ")
End the If

Next p
End the If
Next I

ForEachArray=STR

End the Function


Data is probably this

{
"Key" : "status",
"Items" : [
{
"Value" : "2",
"Desc" : "invalid",
"Count" : 1
},
{
"Value" : "4",
"Desc" : "uncertainty",
"Count" :
2},
{
"Value" : "1",
"Desc", "effective",
"Count" : 21
}
]
}

CodePudding user response:

There is nothing wrong with watching,
Without breaking point is stuck, can step through,
Judging from the information, whether during the execution of a loop, other processes in the modify data?
Single step debugging, other process has not started,

CodePudding user response:

Feel you have a circulation problem, find the STR values should be withdrawn from circulation,
And single step see if cycle in repeated read operation, is to read it again and again from the beginning again the death of the cycle,
  •  Tags:  
  • VBA
  • Related