POV-Ray : Newsgroups : povray.general : Array in function. Not, but... : Re: Array in function. Not, but... Server Time
21 Jun 2024 09:59:04 EDT (-0400)
  Re: Array in function. Not, but...  
From: ingo
Date: 15 Apr 2021 01:59:58
Message: <XnsAD0D515DFFFB7seed7@news.povray.org>
in news:607769cc@news.povray.org Cousin Ricky wrote:

> You've just been burned by POV-Ray's scope leakage, [...]  You will also 
get a parse
> error if you #declare D at the top of your scene file.

Ah. The #declare D is one I've encoutered often and a reason for me to put 
functions in include files as much as possible.

I am aware that the first i lives on after the end of the for loop. It can 
be usefull to do some trickery with.

> I make it a practice never to use a name in a function that is used
> elsewhere in the scene.  [...]

Pseudo namespace are usefull. For many include files I prepend everything 
with the same few letters once they turn into something final. Like arrSPL 
lives in my personal "arr.inc". I saw jr. does the same with fore_ and qq

> Note that you did not need to #undef arrSPL or SPL.  The scene runs
> fine without those 2 #undefs.

I know. In test scenes I keep "stuff" around so I don't forget what I did.



Post a reply to this message

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