POV-Ray : Newsgroups : povray.general : Is it possible to convert a text string to a Macro Identifier ??? : Re: Is it possible to convert a text string to a Macro Identifier??? Server Time
1 Aug 2024 16:31:08 EDT (-0400)
  Re: Is it possible to convert a text string to a Macro Identifier???  
From: Mike E 
Date: 15 Aug 2005 21:40:01
Message: <web.430142f1b67b12baedf9e5ca0@news.povray.org>
Jim Charter <jrc### [at] msncom> wrote:
> This seems to work:
>
> #include "strings.inc"
> #include "colors.inc"
>
>
> #macro Lights ()
>          light_source { <100,1000,-1000>, White}
> #end
>
> #macro Camera ()
>          camera { location <0,1,-16>  look_at <0,0,0>}
> #end
>
> #macro Action ()
>          sphere { 0, .5 pigment { Red } }
> #end
>
> #fopen MyFile "FILEIO5.TXT" write
>
> #write (MyFile,""Lights","Camera","Action"")
> #fclose MyFile
>
> #fopen MyFile "FILEIO5.TXT" read
>
> #read (MyFile,Name1,Name2,Name3)
>
> Parse_String (Name1) ()
> Parse_String (Name2) ()
> Parse_String (Name3) ()
>
> #fclose MyFile



Absolutely awesome response guys! The Parse_String command does exactly what
I'm after. I wish I'd asked this question a year ago. My POV code will
never be the same again.

Thanks Much


Post a reply to this message

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