POV-Ray : Newsgroups : povray.general : a really dumb mistake : Re: a really dumb mistake Server Time
29 Apr 2024 07:01:20 EDT (-0400)
  Re: a really dumb mistake  
From: Bald Eagle
Date: 2 Aug 2017 15:10:00
Message: <web.598222ffd9dfcaaec437ac910@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

> ---------------------------------
> (The proper way to do it):
> #declare MY_VALUE = 10;
>
> #declare C = 1;
> #while(C < 20)
> #if(even(C))
> #declare MY_VALUE = 33;
> #else
> #declare MY_VALUE = 10;
> #end
> #debug concat("\n","My Value = ",str(MY_VALUE,1,0),"\n")
> #declare C = C + 1;
> #end

(The more efficient way to do it):


 #declare C = 1;
 #while(C < 20)
 #declare MY_VALUE = 10;
    #if(even(C))
       #declare MY_VALUE = 33;
    #end
 #debug concat("\n","My Value = ",str(MY_VALUE,1,0),"\n")
 #declare C = C + 1;
 #end



This is why I have my weird way of doing all of the debugging with that #declare
Verbose = true
so that I just plug all the debugging statements in from the start, and then
when everything works, I just switch them ALL off without any more editing.

Been there, done that, SO many times.

Glad you got your code working and regained your sanity.
Reward yourself with an adult beverage!  ;)


Post a reply to this message

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