Mellberg Posted January 16, 2011 Report Share Posted January 16, 2011 Hello! Is there any possibility to get the size of an array from a reference to the array? Since the data type within the array is unknown, I can't convert it to the actual data type and then use the built in 'array size'. Thanks in advance! //Lars Mellberg Quote Link to comment
ShaunR Posted January 16, 2011 Report Share Posted January 16, 2011 Hello! Is there any possibility to get the size of an array from a reference to the array? Since the data type within the array is unknown, I can't convert it to the actual data type and then use the built in 'array size'. Thanks in advance! //Lars Mellberg Quote Link to comment
Ton Plomp Posted January 16, 2011 Report Share Posted January 16, 2011 Hello! Is there any possibility to get the size of an array from a reference to the array? What is an Array? (see next) Shaun's answer provides the number of visible elements for an Array control. However you could get the 'Value' of the array control, that would return a Variant with the OpenG function Array Size(s) the actual size of the data stored in the control: Ton 1 Quote Link to comment
Mellberg Posted January 16, 2011 Author Report Share Posted January 16, 2011 What is an Array? (see next) Shaun's answer provides the number of visible elements for an Array control. However you could get the 'Value' of the array control, that would return a Variant with the OpenG function Array Size(s) the actual size of the data stored in the control: Ton Thanks Ton, looks like what I was looking for! Quote Link to comment
Rolf Kalbermatter Posted February 23, 2011 Report Share Posted February 23, 2011 Thanks Ton, looks like what I was looking for! Please not that this is not exactly a cheap way of determining an array size. The value extraction will create a copy of the array, potentially using quite some memory and also costing performance to do the copy. No problem if your array contains only a few 100 elements but definitely something to think of with an array that could contain 1 million values. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.