POV-Ray : Newsgroups : povray.general : Serializing a dictionary : Re: Serializing a dictionary Server Time
13 Jul 2025 12:16:44 EDT (-0400)
  Re: Serializing a dictionary  
From: jr
Date: 6 Jul 2025 00:10:00
Message: <web.6869f5bde086e5d13ecaab5e6cde94f1@news.povray.org>
hi,

Josh English <Jos### [at] joshuarenglishcom> wrote:
> I have a dictionary in 3.8 and one of the elements is an array.
> ...
> And I'm getting an error:
> Parse Error: Can't nest directives accessing the same file.
> Is there a way around this? I don't want to have to manually write each
> element out.
> I think it requires another macro to convert the .edges element to a
> string that I can then slap into the #write directive. Is this the only
> way or am I missing something?

I've been looking at (un)serialising dictionaries using my 'Filed()' macro[*],
and have not yet found a "good way" for dealing with arrays, especially
multi-dimensional.  I think converting the array to a string, and storing that,
will work, eg "3.1415:1.23:0.1" for an array of three floats; have a look at my
'strSplit()' macro[**] for the unserialising.

[*] <wiki.povray.org/content/User:Jr>
[**] <news.povray.org/web.64b08576d08f3556b49d80446cde94f1%40news.povray.org>


regards, jr.


Post a reply to this message

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