POV-Ray : Newsgroups : povray.bugreports : String parameters in macros do not return value : String parameters in macros do not return value Server Time
28 May 2024 19:17:18 EDT (-0400)
  String parameters in macros do not return value  
From: Samuel van Egmond
Date: 1 Jun 1999 17:24:31
Message: <3754417f.0@news.povray.org>
I can't get string parameters to return a value.  I'm pretty sure I should
be able to do this.  See code for the example:

// Example start

#macro TestString(String)
    // This line should change the parameter, it does not, it only changes
the local value !!!
    #declare String = "Bye Now!"
#end

#macro TestFloat(Float)
    // This line changes the parameter as expected.
    #declare Float = 123.4;
#end

// Works as expected
#local MyFloat = 5;
TestFloat(MyFloat)
#debug str(MyFloat,1,1)

// Does not work as expected
#local MyString = "Hello"
TestString(MyString)
#debug MyString
#debug "\n"

sphere {1,1}   // So the engine doesn't complain...

// Example end

Output is:
123.4Hello

Should be:
123.4Bye Now!

I work on Windows NT on the standard binaries.


Post a reply to this message

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