|
![](/i/fill.gif) |
"twister" <twi### [at] o2 pl> wrote:
> But my intention is to create a #macro that returns spline by value, not by
> parameter as above. I could then use my #macro in this way:
>
> #declare new_spline = createSpline(myArr, 5);
> //where myArr is an array with points defining a curve
Well, the normal procedure for return-by-value from a macro is this:
#macro MyMacro(foo, bar)
#declare myReturnValue = ...<something complicated>...
myReturnValue
#end
I don't see why this shouldn't work for splines, too.
> Question 2: Is there any way (other than using #ifdef command) to check the
> size of an array?
Due to recent discussions, it may not be quite clear what you mean by "size"...
dimension_size(myArray,1) gives you the "official" size of a 1-dimensional
array.
#ifdef(myArray[i]) tests wheter there has actually been a value stored at index
i.
Aside from this, there is nothing. Remember, POV arrays are *not* dynamically
sized; they just might have some elements set to an undefined value (some
"null" value so to speak).
Post a reply to this message
|
![](/i/fill.gif) |