POV-Ray : Newsgroups : povray.newusers : Error-while loop : Re: Error-while loop Server Time
29 Jul 2024 22:30:16 EDT (-0400)
  Re: Error-while loop  
From: Mike Williams
Date: 17 Feb 2005 12:08:28
Message: <$bKc5DAB+MFCFwcZ@econym.demon.co.uk>
Wasn't it Rishi who wrote:
>Hi,
>
>Can someone tell me what is wrong with the following:
>
>#declare row=0;
>#while (row < 24)
>#declare col=4;
>#while (col<16)
>object {T_chair translate <col, 0, row>}
>#declare col=col+4;
>#end
>#declare row=row+6;
>#end
>
>#declare row=0;
>#while (row < 24)
>#declare col=-4;
>#while (col>-16)
>object {T_chair translate <col, 0, row>}
>#declare col=col-4;
>#end
>#declare row=row-6;
>#end
>

The problem is with this bit

#declare row=0;
while (row < 24)
 . . .
#declare row=row-6;
#end

The value of row keeps getting more and more negative and always stays
below 24.

Try using "while (row >-24)"

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.