Title: Variable substitution Post by: sciurius on May 11, 2020, 12:51:43 PM The problem with substituting macro values is that the macro names must be surrounded by spaces.
Function opt2pair provides a workaround for some commands, where options can be specified as NAME= VALUE (note the space), thus allowing for variable substitutions like Trigger Beats = $Macro1 , $Macro2 ... What would break if we add the following functionality to macro.expand: Process the line once and replace all occurrences of $NAME, where NAME is a simple identifier and exists as a defined macro and evaluates to a simple string, by the corresponding value without requiring $[i]NAME[/i] to be surrounded by spaces. My regtests over all examples and library files did not reveal a single change. With the enhanced functionality it will be (finally!) possible to write Code: Set Strong 90 and (in .mmarc) Code: // Sound font. Title: Re: Variable substitution Post by: bvdp on May 11, 2020, 04:11:41 PM Not looking at any code just now, but I think the problem is with needing a trailing space at the end of the macro. I think this whole issue is in the TODO (if not, it should be!). Let me look in the next day ... right after I look at auto midi track allocation :)
|