This is part of the code I'm writing.
#declare RailArray = array[N];
#declare tmp = 0;
#while(tmp<=N)
#declare RailArray[temp] = 0//Spline_1(temp/N);
#end
It gives me an error when I call the part inside the loop. N is equal to 10.
Spline_1 is obviously a spline. I can't figure out why it doesn't like this.
"jkennedy12" <jke### [at] cornellcollegeedu> wrote:
> This is part of the code I'm writing.>> #declare RailArray = array[N];> #declare tmp = 0;> #while(tmp<=N)> #declare RailArray[temp] = 0//Spline_1(temp/N);> #end>> It gives me an error when I call the part inside the loop. N is equal to 10.> Spline_1 is obviously a spline. I can't figure out why it doesn't like this.
Array indexes are 0 based, so an array of dimension N goes from 0 to 1-N.
Try: #while(tmp<N)
-tgq
> #declare RailArray = array[N];
> #declare tmp = 0;
> #while(tmp<=N)
> #declare RailArray[temp] = 0//Spline_1(temp/N);
> #end
What is the error? It probably says what the problem is.
You're using "tmp" and then "temp", for one.
Also, you've removed the semicolon by commenting out the end of the line.
- Slime
...
> Array indexes are 0 based, so an array of dimension N goes from 0 to 1-N.
Array indexes are negative??
A little slip of the fingers there--of course you meant N-1. ;-)
-=- Larry -=-
On 18/04/2011 8:40 AM, Larry Hudson wrote:
> ....>> Array indexes are 0 based, so an array of dimension N goes from 0 to 1-N.>> Array indexes are negative??> A little slip of the fingers there--of course you meant N-1. ;-)>
Good to see you dropping in Larry. I actually mentioned you by name in
telling young Andrew (Invisible) how technology had changed in my
lifetime. I wondered what your view was. If you have the time I would be
interested to hear your Stories.
--
Regards
Stephen