POV-Ray : Newsgroups : povray.general : Automatically named identifiers : Re: Automatically named identifiers Server Time
2 Dec 2024 18:12:24 EST (-0500)
  Re: Automatically named identifiers  
From: Kenneth
Date: 5 Nov 2024 12:15:00
Message: <web.672a5258523ee18491c33a706e066e29@news.povray.org>
"Bald Eagle" <cre### [at] netscapenet> wrote:
>
> You're going to have to use parse_string to make the variable name in each
> iteration.
> Concat "SplineX" with the char corresponding to the letter you want.
>

My own initial (naive) approach to this would be to try and use the Parse_String
macro to the *left* of the = sign, in a #declare. (The macro -- in "strings.inc"
-- takes a string like "MY_VALUE" or "1.5", writes it to an external .tmp file
but without the double quotes, then immediately returns it to the scene.)

So a *simple* example of such a construct would seem to be...

#include "strings.inc"
#declare Parse_String("MY_VALUE")= 27;

I would naively expect this to be the equivalent of...
#declare MY_VALUE = 27;

but it doesn't work: ""Expected 'undeclared identifier', macro identifier found
instead."

I tried other iterations of this and they all fail.

Maybe there are other (more complex?) ways of using Parse_String to accomplish
what the OP wants-- *as* the #declared variable names-- but I don't have a clue
as to how.


Post a reply to this message

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