"twister" <twi### [at] o2 pl> wrote:
> Thanks to all of you. create_spline macro works fine as I wanted to work.
> Due to array size I meant number of elements in the array and for now
> dimension_size is enough for me.
To efficiently check the "populated size" of an array, you could use #ifdef in a
binary search manner:
#local iLastKnownPopulated = -1;
#local iFirstKnownUnpopulated = dimension_size(MyArray,1);
#while (iLastKnownPopulated + 1 < iFirstKnownUnpopulated)
#local iMid = int((iLastKnownPopulated + iFirstKnownUnpopulated)/2);
#ifdef(MyArray[iCenter])
#local iLastKnownPopulated = iMid;
#else
#local iFirstKnownUnpopulated = iMid;
#end
#end
#local PopulatedArraySize = iFirstKnownUnpopulated;
(untested draft)
Post a reply to this message
|