Jump to content
Sign in to follow this  
HeliJunkie

How to use "#define"d value in string ?

Recommended Posts

Hi all!

I ask me, how can I used a "#define"d Value in a String?

Want to use it in description.ext and config.cpp.

Example (wich not work!):

class SampleCtrl {
#define [color=Red]CtrlIDC[/color] 1000
idc = [color=Red]CtrlIDC[/color];
tooltip = "This is idc no: [color=Red]CtrlIDC[/color]";
}

This will be parsed as written.

And using

 tooltip = "This is idc no:" [color=Red]CtrlIdc[/color];

will crash the game.

I don't have any more idea how this may be typed ..... :(

Thanks for any helpful answers!

HeliJunkie

---------- Post added at 21:46 ---------- Previous post was at 21:17 ----------

Found the solution (:bounce3:) a short time after posting the question. Sorry.

The answer is the "__EVAL" macro:

 tooltip = __EVAL("this is idc no: " + str [color=Red]CtrlIdc[/color]);

See http://community.bistudio.com/wiki/Config_Parser

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×