I know that this is more of a FoxPro question, but since I do all of my FoxPro coding by way of FoxWeb, and since there isn't one dominant discussion board for FP, I thought I'd pose this issue here. Apologies to those who might be offended by this. Besides, this group is, by far, the sharpest FoxPro group out there! (Where's the 'Shameless Flattery' emoticon?)
When passing an array to a function (by reference), the function whittles down the array via re-dimensioning. Based upon certain criteria, the array should be emptied and since "Dimension Arr(0)" won't work, I used a "Release Arr" instead. A quick test as to the existence of "Arr" proved that the array had in fact been released. However, when the function ended, I discovered that the array that had been passed to the function and subsequently RELEASEd was still alive and well. I'm almost certain that this isn't by design. My biggest fear is that the memory of the array is in fact released back into the free memory pool and subsequent program execution will stomp all over it. I can code around it, but I just wanted to know if this is a bug, misunderstanding or stupidity on my part. I'm using Visual FoxPro 7 with FoxWeb 2.6.
Within the function, the array can be altered with the "Dimension" command and those changes are seen in the calling program
Since the array is passed by reference, I would have thought that the second "alen" call would either cause an error or yeild a 0. Any thoughts?
"The true measure of a career is to be able to be content, even proud that you succeeded through your own endeavors without leaving a trail of casualties in your wake."