Just wondering if there is a way to use macros in Ruby that does inline substitution, how does C work?
For instance:
define ARGS 1,2 sum(ARGS)
EDIT: More specifically, my problem is more like:
@button1 = FXButton.new(self, "Button 1",:opts => BUTTONPROPERTIES,:width => width, :height => height) @button2 = FXButton.new(self, "Button 2",:opts => BUTTONPROPERTIES,:width => width, :height => height) @button3 = FXButton.new(self, "Button 3",:opts => BUTTONPROPERTIES,:width => width, :height => height)
And ideally, I want the code to look like this:
@button1 = FXButton.new(self, "Button 1", ALLBUTTONPROPERTIES) @button2 = FXButton.new(self, "Button 2", ALLBUTTONPROPERTIES) @button3 = FXButton.new(self, "Button 3", ALLBUTTONPROPERTIES)
Please note that I have the variables “width” and “height” that will not be properly passed to the initialization of the FXButton class if I just set them to some given value. Is there some kind of code replacement that will take care of this problem?
source share