POV-Ray : Newsgroups : povray.animations : Calling an Image Map with an array identifier that stores the image file na= : Re: Calling an Image Map with an array identifier that stores the image file na= Server Time
23 Apr 2024 14:01:35 EDT (-0400)
  Re: Calling an Image Map with an array identifier that stores the image file na=  
From: clipka
Date: 2 Dec 2018 15:55:57
Message: <5c0446dd$1@news.povray.org>
Am 02.12.2018 um 07:25 schrieb Phil:

>                          #declare thisfilename = magik_cube[X][Y][Z][F]
>                          paint_tile(thisfilename)
...
> File 'initialise_cube.mac' line 163: Parse Error: Cannot assign uninitialized
>   identifier.

It is good practice to end each and every `#declare` with a semicolon, 
even in cases where it is entirely optional.

The requirement for a semicolon at some variants of `#declare` is not 
arbitrary: It is required everywhere there is a possibility that the 
right-hand side expression might continue. If POV-Ray comes across a 
macro invocation in such a case, POV-Ray presumes that the macro 
invocation is still part of the right-hand side expression of the 
`#declare`, so `paint_tile(thisfilename)` will take the old value of 
`thisfilename`.


Totally unreleated: It is highly recommend to NOT use all-lowercase 
identifiers, as these may conflict with keywords in future versions.


Post a reply to this message

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