POV-Ray : Newsgroups : povray.general : Unhandled Exception vs. Parse error : Unhandled Exception vs. Parse error Server Time
31 Jul 2024 00:30:08 EDT (-0400)
  Unhandled Exception vs. Parse error  
From: How Camp
Date: 5 Mar 2008 14:50:00
Message: <web.47cef89bf1883a87c59235590@news.povray.org>
I know that trying to call a variable before you declare it is not generally
considered very bright, but I'm attempting to understand what's going on in the
code below:

----------------------------------------
(test.pov)
#declare RdmA = seed(574647);
#include "rand2.inc"
#declare X = RRand(-5,5,RdmA);
#if (Y = 0) #end
----------------------------------------

----------------------------------------
(rand2.inc)
#macro RRand(Min, Max, RS) (rand(RS)*(Max-Min) + Min) #end
----------------------------------------

"rand2.inc" consists of a macro copied from the original "rand.inc" file.  If I
run "test.pov" above, POV-Ray throws an unhandled exception and I'm forced to
close the program.

If, however, I change "test.pov" to be:

----------------------------------------
(test2.pov)
#declare RdmA = seed(574647);
#macro RRand(Min, Max, RS) (rand(RS)*(Max-Min) + Min) #end
#declare X = RRand(-5,5,RdmA);
#if (Y = 0) #end
----------------------------------------

......that is, I replace the '#include' call with the macro from "rand2.inc",
then POV produces a simple parse error, as expected.

So, what's the difference between using this macro in an include file and
placing it directly in my .pov code?

 OS: WinXP
POV: 3.6.1c


Post a reply to this message

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