POV-Ray : Newsgroups : povray.general : Is it possible to convert a text string to a Macro Identifier ??? : Is it possible to convert a text string to a Macro Identifier ??? Server Time
1 Aug 2024 16:30:37 EDT (-0400)
  Is it possible to convert a text string to a Macro Identifier ???  
From: Mike E 
Date: 15 Aug 2005 09:45:00
Message: <web.43009badb594920d0a6eb5d0@news.povray.org>
I am trying to read a text file and call macros according to the names in
the file WITHOUT using a look up table with #if #else or #switch etc.
eg:

assume the text file is: "ROTATE_LEFT","ROTATE_RIGHT",..

#macro ROTATE_LEFT()
blah blah
#end

#macro ROTATE_RIGHT()
blah blah
#end

#read (MyFile,NAME)

NAME() // call the macro ROTATE_LEFT()

- I know this is illegal but this demonstrates what I would like to do, is
there some way I can convert the text string directly to a macro
identifier?


Post a reply to this message

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