Sample program:
Code: Select all
Dim As Integer problemAddress = -1
Dim As String dummy_2(0 To 65535)
Dim As Integer testArray(0 To 65535)
Print "Test"
For i As Integer=0 To 65535
If testArray(i)<>0 Then
problemAddress = i
Print "Unexpected value in array, problemAddress=";problemAddress;", value=";testArray(problemAddress)
EndIf
Next i
If problemAddress <> -1 Then
Print "Print testArray(problemAddress): ";testArray(problemAddress)
Print "Let testArray(problemAddress) = 0"
'try to write zero to the array
testArray(problemAddress)=0
Print "Print testArray(problemAddress): ";testArray(problemAddress)
Else
Print "Everything is fine."
EndIf
Sleep
If it does not crash, then there is an address within the array, that is not initialized to zero. I call this the problemAddress.
This element of the array can not be set to zero, as if it was write protected.
Example output of the program:
Code: Select all
Test
Unexpected value in array, problemAddress= 81, value= 22450
Print testArray(problemAddress): 22450
Let testArray(problemAddress) = 0
Print testArray(problemAddress): 22450
I noticed, that I can work araound the bug, if I declare the array as "shared". But if I do not fully understand what the problem is, I'm not sure if this is a solution or if this just moves the problem to another place / address.