When you write series1.dataProvider = MyArray,you are actually setting the dataProvider property of the series with the contents of myArray.So even if the myArray variable goes out of scope,the dataProvider of series will still have the contents,since the dataProvider remains intact.Hope I answered your question.
> setting the dataProvider property of the series with the contents of myArray.<
Interesting, but you will notice I am setting the contents of myArray to 4 after I make the assignment to dataProvider and dataPRovider sees the change. So it seems that it is "watching" the array? Is it possible that once it sees that the array leaves the scope that it no longer "Watches?" Thanks Bob
Basically when you say series.dataProvider=myArray,the source property of the collection object created will have a source property which will be referencing the same memory (lets say 0x000000)referenced by myArray.Whenever you are saying myArray=5,you are modifying the memory referenced through the handle myArray.Therefore,the change will be reflected in the collection also.When function ends,what is happening is that the myArray handle to the memory 0x000000 is lost.But the memory content will remain since there is a handle via the source of the collection.
This is my explanation for the scenario.I assume this is correct.I feel it is better to confirm with other experts in the forum before coming to a conclusion.
Perfect answer, thanks Bob