TColgp_Array1OfPnt putting values in the array

Hi
I have to make an array which contains 50 points.
like TColgp_Array1OfPnt array (1, 50)
Now do I need to put value for each of the 50 elements?
Like
array.SetValue(1,P)
......
array.SetValue(50,P50)
I tried to run a loop
for (i=0, i { array.SetValue(i,P) }
where the value of P is different.

Is there any other way to solve this??
Regards
Nitin

Nitin's picture

Oh sorry I missed saying that the loop did not work.
Regards
Nitin

Thomas Paviot's picture

The lower bound of the array must be 1, and not 0, otherwise you set 51 values. In your for loop, you should iterate from i=1.

Thomas

Nitin's picture

Hi Thomas
Thanks for the reply.
I tried using the loop with i=1. It compiles successfully but on executing it gives the error:
008EEB70: Standard_OutOfRange
Regards
Nitin