POV-Ray : Newsgroups : povray.pov4.discussion.general : I want to be rid of my stupid mistakes : Re: I want to be rid of my stupid mistakes Server Time
6 May 2024 13:24:00 EDT (-0400)
  Re: I want to be rid of my stupid mistakes  
From: clipka
Date: 23 Jul 2009 14:05:00
Message: <web.4a68a63f97aca271aca5323b0@news.povray.org>
"Trevor G Quayle" <Tin### [at] hotmailcom> wrote:
> Render cancelled by user.
> Break point:
> File: C:\POVDIR\POVFILE.pov  Line: 9
>      #declare j=j+1;
> Active loop:
> File: C:\POVDIR\POVFILE.pov  Line: 6
> #while (i<100)
> Iteration count: 12345
> Active loop:
> File: C:\POVDIR\POVFILE.pov  Line: 8
>   #while (j<100)
> Iteration count: 67

Nice one. That would indeed be handy.

> I'm not
> familiar with the code, but I should think it wouldn't be an overly difficult
> task to add this as POV would already need to keep track of open loops within
> it's code parsing.

I haven't paid much attention to loop handling yet, but nested loops are handled
by recursive calls, and I guess aborting parsing is done by throwing an
exception; so it would mean adding...

- a local variable to count loop iterations while in a loop
- code to catch the exception while in a loop, and throw it onward with added
information about the current loop
- code to pass the detailed information to the front-end
- code in the front-end to output the information

Nothing that sounds dramatically complicated.

Being on it, it would be nice to have the same mechanism kick in if parsing is
aborted for any other reason.

Another thing that would greatly faciliate debugging would be a simpler syntax
to output a single variable, so that for instance

  #declare Foo = 47.11000;
  #local Bar = sphere { <0,0,0>, 1 }

  #debug_var Foo, Bar
  #debug_var Foobar

might print:

  Foo (global): 47.11
  Bar (local): object
  Foobar: undefined


Post a reply to this message

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