POV-Ray : Newsgroups : povray.general : coding question--position of #if block in SDL : coding question--position of #if block in SDL Server Time
30 Jul 2024 02:26:11 EDT (-0400)
  coding question--position of #if block in SDL  
From: Kenneth
Date: 28 Jan 2010 11:05:01
Message: <web.4b61b48bec0a930165f302820@news.povray.org>
A very basic computing question, which I don't know the answer to, sorry to say.

Suppose I have a gigantic scene file, with lots of #includes, etc. Plus an #if
block at the very end:

#declare A = 1; // a boolean value
#include .....
#include .....
#include .....
.........
.........
.........
.........
.........
#if(A)
--do something--
#else
#end
--end of scene file---

I'm not a software engineer or a full-blown programmer, so my question (actually
two) concerns the scene's parse time:
1) When the #if is finally 'processed', does POV-Ray (or any coding language)
have to search back through the entire code to find A?
2) If so, would the scene parse faster if the #if block was nearer to the
#declared A?

#declare A = 1;
#if(A)
--do something--
#else
#end
#include .....
#include .....
#include .....
.........
.........
.........
.........
.........
--end of scene file---

Perhaps the #includes muddy the issue, but I'm mostly concerned about the
fastest ordering of elements in general.

Ken


Post a reply to this message

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