MATLAB: Can a string be evaluated within a TLC file using custom code such that they can be printed in the generated code

simulink

I have many S-functions within my model. I would like to assign function calls within strings and have them evaluated in TLC files, and have them evaluated assignments in the printed code. Is that possible? 
Consider the following code in a TLC file:
%assign outport_1=LibBlockOutputSignal(0,"","",0)

%<outport_1>=100;
This prints the following line in the generated C-code:
var_output1=100;
Now assume that I make the following modifications to the TLC file such that the assignment for "outport_1" is within a string, that is:
%assign outport_1=LibBlockOutputSignal(0,"","",0)
%assign exp_01="%<outport_1>=100;"
How can I get the compiler to evaluate the "exp_01" such that the generated C-code contains the same line as in the code segment above? 

Best Answer

Strings can be evaluated with the %<expr> directive as highlighted in the following documentation link:
If the %<expr> directive is used after the string assignment in the TLC file, as follows:
%assign outport_1=LibBlockOutputSignal(0,"","",0)
%assign exp_01="%<outport_1>=100;"
%<exp_01>
The third line evaluates the string "exp_01" and prints the following in the generated code:
var_output1=100;