POV-Ray : Newsgroups : povray.advanced-users : Break out of main while (1) loop using #break directive in a sub-loop state= Server Time
21 Nov 2024 17:42:14 EST (-0500)
  Break out of main while (1) loop using #break directive in a sub-loop state= (Message 11 to 11 of 11)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Bill Pragnell
Subject: Re: Break out of main while (1) loop using #break directive in a sub-loop s=
Date: 18 Jan 2023 18:25:00
Message: <web.63c87f5842c56c9cb96893c06f35e431@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> That is very clever, and will go into my 'bag of tricks'. Thanks.

The best part is that the sub-arrays don't all need to be the same size.

#declare A = array[3];
#declare A[0] = array[4];
#declare A[1] = array[9];
#declare A[2] = array[16];

and if you don't know how big they are, e.g. you've got some macro that fills
them for you, you can just do

#for (I, 0, 2)
 #declare N = dimension_size(A[I], 1);
 #for (J, 0, N-1)
  // do mad pov stuff with A[I][J]
 #end
#end


Bill


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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