I am working with a project dealing with plotting of X-Y data. I am doing testing using an example in our code bank, that was created by others, long ago, to test/demonstrate the plotting of random data points on top of fixed internal-to-the-chart boundary lines. As part of testing (and learning) I stripped out the random generated data points, and created a simple array (arrvalues) of some data points to plot.
These values from arrvalues were assigned (in)to the "main" data array (LL_PI_DataArray ), and the rest of this main data array used for plotting (LL_PI_DataArray) was filled with the data for the various fixed lines. See Example Project posted as attachment.
When I direct assign my data points in arrvalues to the plotting array LL_PI_DataArray .. as in
The arrvalues points plot fine, BUT, if I create the Array arrValues, and then instead of assigning them into the LL_PI_DataArray with statements as above, I try to assign these values to the LL_PI_DataArray directly, like this:
Code:
'>>>>> try to copy the values of the arrvalues array to the LL_PL_DataArray
LL_PI_DataArray = arrvalues ' The offending statement
the main fixed lines come out OK, but the data points from the arrValues are strange.
Moved from the CodeBank, which is for finished snippets rather than questions.
Not familiar with this administrative aspect of the forum.. Question - If a project (like what I attached) is posted, does the system automatically include it in some other area for complete functionality code? I had attached the example so as to make the error-issue better apparent than posting out-takes from it. Should I have instead posted the code in the main body between CODE CODE of the forum editor?
As to the question itself about the hinky error - It came to mind that maybe although I can "assign" one array to another array, that such action does not place the values of SoruceArray into Target Array? I am trying to avoid having to do an element by element looping placement of the data in SourceArray to Target Array, but maybe I indeed have to do that?
I read another thread titled Copying-of-one-Array-to-another https://www.vbforums.com/showthread....ray-to-another and perhaps it is that a direct assignment only works if the data is non-string? My data is non-string, so I it looks like I am fallen into a rabbit hole ( of my own making).
Last edited by clickman; Nov 23rd, 2020 at 06:32 AM.
It came to mind that maybe although I can "assign" one array to another array, that such action does not place the values of SoruceArray into Target Array?
What else do you think assignment might mean?
Yes, array assignment copies the values. Both should be dynamic arrays and of the same data type.