If you assign the handle of an object (for example a window) to an array whose datatype is any, the result is incorrect: you always get 0.
Reproducing the Issue
- Create an external DataWindow object with a column of type long
- Assign this object to a DataWindow controldw_1
Code the following script in the Open event of the DataWindow control
la_array = Handle(this)
dw_1.SetItem(1, 1, la_array)
dw_1.SetItem(2, 1, Handle(this))
You will see that values of each row are different !!
For your convenience, seeattached example
As a workaround, you can cast the any array to a Long as follows: la_array = Long(Handle(this))